lancerhe/php-redis-sentinel

There is no license information available for the latest version (dev-master) of this package.

php library redis sentinel.

dev-master 2015-08-30 05:30 UTC

This package is auto-updated.

Last update: 2024-11-05 15:16:40 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

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.