|
NAMERedisDB::Sentinel - interface to redis servers managed by sentinel SYNOPSIS use RedisDB::Sentinel;
my $redis = RedisDB::Sentinel->connect_to_master(
service => $service_name,
sentinels => [
{
host => 'host1',
port => 26379
},
{
host => 'host2',
port => 26379
},
],
);
$redis->set( $key, $value );
my $value = $redis->get($key);
DESCRIPTIONThis module provides interface to access redis servers managed by sentinels, it handles communication with sentinels and dispatches commands to the master redis. METHODS$class->connect_to_master(%params)retrieve information about master from sentinel and return RedisDB object connected to master. Additionally sets on_conect_error handler to retrieve information about new master in case of reconnect. Requires two parameters:
Other parameters are passed as is to constructor of RedisDB object. Note, that host, port, and on_connect_error parameters will be overwritten by RedisDB::Sentinel AUTHORPavel Shaydo, "<zwon at cpan.org>" LICENSE AND COPYRIGHTCopyright 2011-2021 Pavel Shaydo. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.
|