91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

redis集群宕機后怎么重啟

小新
413
2021-01-14 09:24:02
欄目: 云計算

redis集群宕機后怎么重啟

redis集群宕機后重啟的示例:

centos下的redis無數據啟動和持久化重啟腳本:

1.redis_clear_restart.sh,代碼:

for p in `ps -ef|grep /usr/local/bin/redis-server | awk '{print $2"_"$3}'`

do

a=`echo $p |awk -F _ '{print $1}'`

b=`echo $p |awk -F _ '{print $2}'`

if [ $b == "1" ]; then

echo "kill -9 $a `kill -9 $a` "

fi

done

echo "rm -rf appendonly_*.aof dump_*.rdb nodes-2000*.conf"

rm -rf appendonly_*.aof dump_*.rdb nodes-2000*.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20000.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20001.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20002.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20003.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20004.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20005.conf

/usr/local/bin/redis-cli -a 123456 --cluster create --cluster-replicas 1 127.0.0.1:20000 127.0.0.1:20001 127.0.0.1:20002 127.0.0.1:20003 127.0.0.1:20004 127.0.0.1:20005 <F

yes

EOF

2.redis_dump_restart.sh,代碼:

for p in `ps -ef|grep /usr/local/bin/redis-server | awk '{print $2"_"$3}'`

do

a=`echo $p |awk -F _ '{print $1}'`

b=`echo $p |awk -F _ '{print $2}'`

if [ $b == "1" ]; then

echo "kill -9 $a `kill -9 $a` "

fi

done

echo "rm -rf appendonly_*.aof dump_*.rdb nodes-2000*.conf"

rm -rf appendonly_*.aof dump_*.rdb nodes-2000*.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20000.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20001.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20002.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20003.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20004.conf

/usr/local/bin/redis-server /home/sysusr/redis/redis-cluster/redis-20005.conf

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20000

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20001

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20002

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20003

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20004

/usr/local/bin/redis-cli -a 123456 --cluster check 127.0.0.1:20005

0
清涧县| 汤原县| 观塘区| 鄂伦春自治旗| 黑龙江省| 聂拉木县| 上蔡县| 旺苍县| 达拉特旗| 犍为县| 基隆市| 武平县| 佛学| 锡林郭勒盟| 隆德县| 西华县| 平凉市| 额济纳旗| 监利县| 涪陵区| 梁平县| 泸水县| 连南| 长宁县| 云梦县| 鹰潭市| 绥化市| 屏东市| 五华县| 瑞昌市| 东港市| 新源县| 衡南县| 普兰店市| 平利县| 梁山县| 灵台县| 黑龙江省| 黄大仙区| 涡阳县| 始兴县|