标签:code shutdown 修改 有一个 led shu 位置 centos 创建
Redis集群中至少应该有三个节点。要保证集群的高可用,需要每个节点有一个备份机。Redis集群至少需要6台服务器。
搭建伪分布式。可以使用一台虚拟机运行6个redis实例。
修改redis的端口号7001-7006
yum install ruby
yum install rubygems
gem install redis-3.0.0.gem
redis源码/src/redis-trib.rb
cluster-enabled yes
./redis-trib.rb create --replicas 1
192.168.25.128:7001 192.168.25.128:7002 192.168.25.128:7003 192.168.25.128:7004
192.168.25.128:7005 192.168.25.128:7006
redis-cli -p 7002 -c
//-c 表示连接集群
cd /usr/local/src/redis-cluster/redis7001
./redis-server redis.conf
cd /usr/local/src/redis-cluster/redis7002
./redis-server redis.conf
cd /usr/local/src/redis-cluster/redis7003
./redis-server redis.conf
cd /usr/local/src/redis-cluster/redis7004
./redis-server redis.conf
cd /usr/local/src/redis-cluster/redis7005
./redis-server redis.conf
cd /usr/local/src/redis-cluster/redis7006
./redis-server redis.conf
cd /usr/local/src
cd /usr/local/src/redis-cluster/redis7001
./redis-cli -p 7001 shutdown
./redis-cli -p 7002 shutdown
./redis-cli -p 7003 shutdown
./redis-cli -p 7004 shutdown
./redis-cli -p 7005 shutdown
./redis-cli -p 7006 shutdown
cd /usr/local/src
标签:code shutdown 修改 有一个 led shu 位置 centos 创建
原文地址:https://www.cnblogs.com/-saligia-/p/9749598.html