——这个实验是后面实验的基础,所以称之为实验零点五
实验前准备
Master节点:192.168.188.14
Slave节点1:192.168.188.15
Slave节点2:192.168.188.16
关闭防火墙
systemctl stop firewalld
setenforce 0
——本实验建立在实验零点五的基础上,前面的配置过程请看上一个实验
实验前准备
Master节点:192.168.188.14
Slave节点1:192.168.188.15
Slave节点2:192.168.188.16
关闭防火墙
systemctl stop firewalld
setenforce 0
——本实验需要6个节点,3主3从,但是考虑到我电脑性能,决定把6个服务部署在一台虚拟机上,并以端口号进行区分
实验前准备
主节点:192.168.188.14:6001、192.168.188.14:6002、192.168.188.14:6003
从节点:192.168.188.14:6004、192.168.188.14:6005、192.168.188.14:6006
关闭防火墙
systemctl stop firewalld
setenforce 0
for i in {1..6}
do
cp /opt/redis-5.0.7/redis.conf /etc/redis/redis-cluster/redis600$i
cp /opt/redis-5.0.7/src/redis-cli /opt/redis-5.0.7/src/redis-server /etc/redis/redis-cluster/redis600$i
done
for d in {1..6}
do
cd /etc/redis/redis-cluster/redis600$d
redis-server redis.conf
done
redis-cli --cluster create 127.0.0.1:6001 127.0.0.1:6002 127.0.0.1:6003 127.0.0.1:6004 127.0.0.1:6005 127.0.0.1:6006 --cluster-replicas 1