Predixy 代理 Redis Cluster 集群

1、环境

服务器名称IP地址备注
predixy-161-13010.32.161.130Predixy
redis-161-13110.32.161.131redis节点
redis-161-13210.32.161.132redis节点
redis-161-13310.32.161.133redis节点
redis-161-13410.32.161.134redis节点
redis-161-13510.32.161.135redis节点
redis-161-13610.32.161.136redis节点

2、Redis安装及集群创建

参考:https://blog.csdn.net/a120608yby/article/details/140641309

 3、Predixy安装及配置

# 下载程序包
wget -P /usr/local/src https://github.com/joyieldInc/predixy/releases/download/1.0.5/predixy-1.0.5-bin-amd64-linux.tar.gz
 
# 安装
# cd /usr/local/src
# tar xf predixy-1.0.5-bin-amd64-linux.tar.gz -C /usr/local/
# cd /usr/local/
# mv predixy-1.0.5/ predixy
 
# 配置环境变量
# vim /etc/profile.d/predixy.sh
export PATH=$PATH:/usr/local/predixy/bin
# source /etc/profile.d/predixy.sh
 
# 修改配置
# vim conf/predixy.conf
...
Bind 0.0.0.0:7617
Include cluster.conf
# Include try.conf
...
 
# vim cluster.conf
ClusterServerPool {
    Password password
    MasterReadPriority 60
    StaticSlaveReadPriority 50
    DynamicSlaveReadPriority 50
    RefreshInterval 1
    ServerTimeout 1
    ServerFailureLimit 10
    ServerRetryTimeout 1
    KeepAlive 120
    Servers {
        + 10.32.161.131:6379
        + 10.32.161.132:6379
        + 10.32.161.133:6379
        + 10.32.161.134:6379
        + 10.32.161.135:6379
        + 10.32.161.136:6379
    }
}
 
# vim auth.conf
Authority {
    Auth "password" {
        Mode write
    }
    Auth "password" {
        Mode admin
    }
}
 
# 配置启动服务
# vim /etc/systemd/system/predixy.service
[Unit]
Description=predixy
Documentation=https://github.com/joyieldInc/predixy
Wants=network-online.target
After=network-online.target
 
[Service]
PrivateTmp=true
User=root
Group=root
ExecStart=/usr/local/predixy/bin/predixy /usr/local/predixy/conf/predixy.conf
StandardOutput=journal
StandardError=inherit
 
[Install]
WantedBy=multi-user.target
 
#启动服务
systemctl enable --now predixy

4、验证

# redis-cli -p 7617 -a password
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:7617> set zhangsan 123
OK
127.0.0.1:7617> set lisi 456
OK
127.0.0.1:7617> set test 321
OK
127.0.0.1:7617> get zhangsan
"123"
127.0.0.1:7617> get lisi
"456"
127.0.0.1:7617> get test
"321"
127.0.0.1:7617>

参考:

https://github.com/joyieldInc/predixy
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值