qbnk/redisgateway 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

qbnk/redisgateway

Composer 安装命令:

composer require qbnk/redisgateway

包简介

An abstraction layer which handles master/slave quorum and works as a proxy for the php-redis-extension

README 文档

README

This class is intended to add an abstraction layer between a PHP application and a Redis setup that contains master and slave(s) instances which are monitored by RedisSentinels.

The idea is that this is exchangeable with a simple \Redis class, but also handles direction to a new master instance in case of a node failure.

Before:

$client = new Redis();
$client->connect('127.0.0.1', 6379, 0, null, 0, 0);

$client->auth('qwerty');
$client->select(123);

After:

$client = new \QBNK\Redis\RedisGateway();

$client->addSentinels([
    new RedisSentinel('10.0.0.100', 26379),
    new RedisSentinel('10.0.0.101', 26379),
    new RedisSentinel('10.0.0.102', 26379)
]);

$client->auth('qwerty');
$client->select(123);

For setups where the Redis sentinels are not aware of the public IP addresses (eg virtual machines that are only aware of internal IP addresses), you can add IP mappings to RedisGateway

$alias1 = new \QBNK\Redis\Alias('127.0.0.1', '1.2.3.4', 1234, 5678);
$alias2 = new \QBNK\Redis\Alias('127.0.0.2', '1.2.3.5', 1235, 5679);


$client = new \QBNK\Redis\RedisGateway();
$client
    ->addAlias($alias1)
    ->addAlias($alias2);

统计信息

  • 总下载量: 8.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固