redis集群2

来源:互联网 发布:法比奥奥奥 知乎 编辑:程序博客网 时间:2024/05/29 08:19

1、安装虚拟机centos7

http://blog.csdn.net/wuhenzhangxing/article/details/78810356

http://blog.csdn.net/wuhenzhangxing/article/details/78810277

2、centos7 通用redis环境搭建redis-trib.rb  https://www.cnblogs.com/wuxl360/p/5920330.html

3\安装ruby

4\1.安装curl

sudo yum install curl

2. 安装RVM

curl -L get.rvm.io | bash -s stable 

3. source /usr/local/rvm/scripts/rvm

4. 查看rvm库中已知的ruby版本

rvm list known

5. 安装一个ruby版本

rvm install 2.4.1

6. 使用一个ruby版本

rvm use 2.4.1

7. 设置默认版本

rvm remove 2.0.0

8. 卸载一个已知版本

ruby --version

9. 再安装redis就可以了

gem install redis

5\建集群时,连不上,需要对端口访问进行处理,简单点sudo iptables -F

6、[ERR] Node is not empty. Either the node already knows other nodes (check with C

pkill -9 redis 删除文件夹下的nodes-*,dump-*.rdb ,*.aof,重新使用ri

redis-trib.rb  create  --replicas  1  192.168.1.199:7000 192.168.1.199:7001  192.168.1.199:7002 192.168.1.250:7000  192.168.1.250:7001  192.168.1.250:7002搭建集群

7、redis-cli -h 192.168.31.245 -c -p 7002  ,加参数 -C 可连接到集群

8、连接建立后,kill -9个redis,重连前部分数据读取设置不到,但是重连后就调到slave节点



原创粉丝点击