中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

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
太仓市| 东乌| 滦南县| 永丰县| 前郭尔| 隆林| 蓬安县| 隆安县| 孝昌县| 长子县| 新丰县| 朔州市| 安仁县| 长泰县| 新龙县| 麻江县| 平谷区| 乌什县| 即墨市| 钦州市| 隆尧县| 邛崃市| 金溪县| 苗栗县| 安龙县| 英山县| 浠水县| 清丰县| 安徽省| 肇东市| 无极县| 关岭| 道真| 墨玉县| 郁南县| 龙江县| 文化| 奇台县| 巨野县| 苏州市| 安康市|