优化集群创建脚本

This commit is contained in:
flswld
2023-05-28 19:54:03 +08:00
parent 3100e8b147
commit 98976d7a7d
13 changed files with 1081 additions and 69 deletions

View File

@@ -0,0 +1,11 @@
#!/bin/sh
IP=$1
echo "update redis config, host ip: ${IP}"
sed -i s/192.168.199.233/"${IP}"/ ./redis1/redis.conf
sed -i s/192.168.199.233/"${IP}"/ ./redis2/redis.conf
sed -i s/192.168.199.233/"${IP}"/ ./redis3/redis.conf
sed -i s/192.168.199.233/"${IP}"/ ./redis4/redis.conf
sed -i s/192.168.199.233/"${IP}"/ ./redis5/redis.conf
sed -i s/192.168.199.233/"${IP}"/ ./redis6/redis.conf

View File

@@ -1,10 +1,13 @@
#!/bin/sh
IP=$1
echo "create redis cluster, host ip: ${IP}"
redis-cli -a 123456 --cluster create \
192.168.199.233:6371 \
192.168.199.233:6372 \
192.168.199.233:6373 \
192.168.199.233:6374 \
192.168.199.233:6375 \
192.168.199.233:6376 \
"${IP}":6371 \
"${IP}":6372 \
"${IP}":6373 \
"${IP}":6374 \
"${IP}":6375 \
"${IP}":6376 \
--cluster-replicas 1