编译 redis-cluster-proxy

2020-07-22  本文已影响0人  风亡小窝

1. 下载

git clone https://github.com/RedisLabs/redis-cluster-proxy.git

2. 编译

自 redis 6.0.0 之后,编译 redis 需要支持 C11 特性,redis-cluster-proxy同样如此
Centos7 默认 gcc 版本为 4.8.5,C11 特性在 4.9 中引入

解决方法
安装 Developer Toolset 9 使用 gcc 9 编译

yum install centos-release-scl devtoolset-9

查看scl安装了哪些包

scl -l

这不会更新系统原有 gcc 软件包,在当您需要使用 gcc 9 工具链时,使用下列命令进入环境

scl enable devtoolset-9 bash
cd redis-cluster-proxy
make install
whereis redis-cluster-proxy
# redis-cluster-proxy: /usr/local/bin/redis-cluster-proxy

3. 运行

redis-cluster-proxy 默认监听在 127.0.0.0:7777

127.0.0.1:6379 为集群中任一节点

redis-cluster-proxy 127.0.0.1:6379
上一篇 下一篇

猜你喜欢

热点阅读