2017 © Pedro Peláez
 

package redis_sentinel

redis sentinel client for php 5.3+

image

jenner/redis_sentinel

redis sentinel client for php 5.3+

  • Tuesday, January 3, 2017
  • by huyanping
  • Repository
  • 3 Watchers
  • 32 Stars
  • 5,357 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 4 Versions
  • 22 % Grown

The README.md

redis-sentinel

Latest Stable Version Total Downloads Latest Unstable Version License travis, (*1)

redis-sentinel client for php based on phpredis extension., (*2)

examples

Get Redis master address and create Redis object:, (*3)

$sentinel = new \Jenner\RedisSentinel\Sentinel();
$sentinel->connect('127.0.0.1', 6379);
$address = $sentinel->getMasterAddrByName('mymaster');

$redis = new Redis();
$redis->connect($address['ip'], $address['port']);
$info = $redis->info();
print_r($info);

Create redis-sentinel pool and create Redis object:, (*4)

$sentinel_pool = new \Jenner\RedisSentinel\SentinelPool();
$sentinel_pool->addSentinel('127.0.0.1', 26379);
$sentinel_pool->addSentinel('127.0.0.1', 26380);

$address = $sentinel_pool->master('mymaster');
print_r($address);

$redis = $sentinel_pool->getRedis('mymaster');
$info = $redis->info();
print_r($info);

In order to prevent redis/sentinel to wait too long for connections in case of issues with the Redis backend it's advisable to use a timeout (in seconds):, (*5)

$sentinel_pool->addSentinel('127.0.0.1', 26380, 1.0); # 1 second timeout

The Versions

03/01 2017

dev-master

9999999-dev

redis sentinel client for php 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-redis >=2.2.8

 

sentinel redis sentinel sentinel client redis sentinel client

03/01 2017

0.3.0

0.3.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-redis >=2.2.8

 

30/12 2016

0.2.0

0.2.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-redis >=2.2.8

 

29/12 2016

0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-redis >=2.2.8