坑仍是比較多的吧 安全組必不可少開啓 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集羣密碼