坑还是比较多的吧
安全组必不可少开启 22121 22122 22123 22124 22222
aliyun 搭建redis集群https://my.oschina.net/u/3647713/blog/1982995
安装autoconf
cd /usr/local
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local
make && make install
twemproxy
cd /usr/local
wget https://github.com/twitter/twemproxy/archive/master.zip
unzip master.zip -d /usr/local/
cd /usr/local
mv twemproxy-master twemproxy
cd twemproxy
CFLAGS="-ggdb3 -O0" autoreconf -fvi
./configure --prefix=/usr/local/twemproxy
make && make install
修改配置文件 /usr/local/twemproxy/conf/nutcracker
alpha:
listen: 0.0.0.0:22121
hash: fnv1a_64
distribution: ketama
auto_eject_hosts: true
redis: true
server_retry_timeout: 2000
server_failure_limit: 1
servers:
- 外网地址:7000:1
- 外网地址:7001:1
- 外网地址:7002:1
- 外网地址:7003:1
- 外网地址:7004:1
- 外网地址:7005:1
启动nutcracker ./conf/nutcracker.yml
netstat -tunlp|grep nutcracker
tcp 0 0 0.0.0.0:22121 0.0.0.0:* LISTEN 3090/nutcracker
tcp 0 0 127.0.0.1:22122 0.0.0.0:* LISTEN 3090/nutcracker
tcp 0 0 127.0.0.1:22123 0.0.0.0:* LISTEN 3090/nutcracker
tcp 0 0 127.0.0.1:22124 0.0.0.0:* LISTEN 3090/nutcracker
tcp 0 0 0.0.0.0:22222 0.0.0.0:* LISTEN 3090/nutcracker
报错
(error) MOVED 12291 39.104.84.171:7002
创建连接时需要加上 -c
(error) NOAUTH Authentication required.
创建链接时候要机上密码
./redis-cli -h 阿里云外网ip -p 22121 -c -a redis集群密码
来源:oschina
链接:https://my.oschina.net/u/3647713/blog/2046389