lancerhe / php-redis-sentinel
php library redis sentinel.
Installs: 5 066
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
This package is auto-updated.
Last update: 2024-11-05 15:16:40 UTC
README
Crypt for AES, RSA, 3DES and some special algorithms.
Requirements
PHP5.3.0 or later
Installation
Create or modify your composer.json
{ "require": { "lancerhe/php-redis-sentinel": "dev-master" } }
Usage
<?php require('./vendor/autoload.php'); $master_name = 'my_master'; $sentinel = new \RedisSentinel\Sentinel($master_name); $sentinel->add(new \RedisSentinel\Client('192.168.1.2', 26379)); $sentinel->add(new \RedisSentinel\Client('192.168.1.3', 26379)); $sentinel->add(new \RedisSentinel\Client('192.168.1.4', 26379)); var_dump( $sentinel->getMaster() ); var_dump( $sentinel->getSlaves() ); var_dump( $sentinel->getSlave() ); // Random, one of slaves.