博客
关于我
使用predixy 连接 redis-cluster 集群
阅读量:324 次
发布时间:2019-03-04

本文共 1773 字,大约阅读时间需要 5 分钟。

配置编译环境

确保服务器环境

  • 确保服务器上已安装Redis,确保其运行状态正常。
  • 安装依赖包

    1. 安装必要的系统依赖包:
    2. yum install libstdc++-static -y
      1. 安装下载工具:
      2. yum install wget -y

        获取资源

      3. 下载预置包:
      4. wget https://github.com/joyieldInc/predixy/archive/1.0.5.tar.gz
        1. 将包解压至 /usr/local/src 目录:
        2. cd /usr/local/srctar -zxvf 1.0.5.tar.gz

          安装与编译

        3. 进入解压目录并编译:
        4. make -j4

          如遇到 make: command not found 错误,请先安装开发工具包:

          yum -y install gcc automake autoconf libtool make#安装g++:yum install gcc gcc-c++
          1. 将编译好的可执行文件拷贝至 /usr/local/bin 目录:
          2. cd srccp predixy /usr/local/bin/
            1. 拷贝配置文件:
            2. cp /usr/local/src/predixy-1.0.5/conf/* /usr/local/bin

              修改配置文件

            3. 修改 cluster.conf 文件:
            4. # 修改 /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    }}
              1. 修改 predixy.conf 文件:
              2. # 修改 /usr/local/bin/predixy.conf

                提供的示例配置文件如下:

                #################################### 服务器配置###################################Include cluster.confInclude sentinel.confInclude try.conf#################################### Redis代理配置#################################### 代理连接端口号,默认为 7617
                1. 修改 auth.conf 文件:
                2. # 修改 /usr/local/bin/auth.conf

                  提供的示例配置文件如下:

                  Authority {    # 代理连接密码    Auth "123456789" {        Mode write    }}

                  启动 predixy

                3. 进入 /usr/local/bin 目录并启动服务:
                4. cd /usr/local/binnohup predixy predixy.conf > /tmp/predixy.log 2>&1 &
                  1. 查看启动日志:
                  2. tail -f /tmp/predixy.log
                    1. 连接 predixy 代理操作 Redis 数据:
                    2. 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/

    你可能感兴趣的文章
    npm build报错Cannot find module ‘webpack‘解决方法
    查看>>
    npm ERR! ERESOLVE could not resolve报错
    查看>>
    npm ERR! Unexpected end of JSON input while parsing near ‘...“:“^1.2.0“,“vue-html-‘ npm ERR! A comp
    查看>>
    npm error Missing script: “server“npm errornpm error Did you mean this?npm error npm run serve
    查看>>
    npm error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装
    查看>>
    npm install CERT_HAS_EXPIRED解决方法
    查看>>
    npm install digital envelope routines::unsupported解决方法
    查看>>
    npm install 卡着不动的解决方法
    查看>>
    npm install 报错 EEXIST File exists 的解决方法
    查看>>
    npm install 报错 ERR_SOCKET_TIMEOUT 的解决方法
    查看>>
    npm install 报错 Failed to connect to github.com port 443 的解决方法
    查看>>
    npm install 报错 fatal: unable to connect to github.com 的解决方法
    查看>>
    npm install 报错 no such file or directory 的解决方法
    查看>>
    npm install 权限问题
    查看>>
    npm install报错,证书验证失败unable to get local issuer certificate
    查看>>
    npm install无法生成node_modules的解决方法
    查看>>
    npm install的--save和--save-dev使用说明
    查看>>
    npm node pm2相关问题
    查看>>
    npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
    查看>>
    npm run build报Cannot find module错误的解决方法
    查看>>