本文共 1814 字,大约阅读时间需要 6 分钟。
yum install libstdc++-static -y
yum install wget -y
wget https://github.com/joyieldInc/predixy/archive/1.0.5.tar.gz
/usr/local/src 目录:cd /usr/local/srctar -zxvf 1.0.5.tar.gz
make -j4
如遇到 make: command not found 错误,请先安装开发工具包:
yum -y install gcc automake autoconf libtool make#安装g++:yum install gcc gcc-c++
/usr/local/bin 目录:cd srccp predixy /usr/local/bin/
cp /usr/local/src/predixy-1.0.5/conf/* /usr/local/bin
cluster.conf 文件:# 修改 /usr/local/bin/cluster.conf
提供的示例配置文件如下:
ClusterServerPool { # Redis集群服务器配置 Password 123456789 MasterReadPriority 60 StaticSlaveReadPriority 50 DynamicSlaveReadPriority 50 RefreshInterval 1 ServerTimeout 1 ServerFailureLimit 10 ServerRetryTimeout 1 KeepAlive 120 Servers { +127.0.0.1:7001 +127.0.0.1:7002 +127.0.0.1:7003 +127.0.0.1:7004 +127.0.0.1:7005 +127.0.0.1:7006 }} predixy.conf 文件:# 修改 /usr/local/bin/predixy.conf
提供的示例配置文件如下:
#################################### 服务器配置###################################Include cluster.confInclude sentinel.confInclude try.conf#################################### Redis代理配置#################################### 代理连接端口号,默认为 7617
auth.conf 文件:# 修改 /usr/local/bin/auth.conf
提供的示例配置文件如下:
Authority { # 代理连接密码 Auth "123456789" { Mode write }} /usr/local/bin 目录并启动服务:cd /usr/local/binnohup predixy predixy.conf > /tmp/predixy.log 2>&1 &
tail -f /tmp/predixy.log
redis-cli -h 192.168.11.203 -p 7617 -a 123456789
提供一个启动脚本:
#!/bin/bashcd /usr/local/binnohup predixy predixy.conf > /tmp/predixy.log 2>&1 &echo "启动成功..."
转载地址:http://qduh.baihongyu.com/