亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

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
邢台市| 酒泉市| 蓝田县| 灵璧县| 绵竹市| 南阳市| 安溪县| 洛宁县| 顺平县| 黄龙县| 芦溪县| 丹凤县| 日照市| 广河县| 东台市| 宕昌县| 鄂伦春自治旗| 博罗县| 平顺县| 揭西县| 巨鹿县| 清流县| 会理县| 察哈| 徐水县| 丁青县| 赤壁市| 确山县| 高雄县| 剑河县| 噶尔县| 萨嘎县| 进贤县| 洛隆县| 永城市| 鄂托克旗| 清丰县| 抚松县| 托克托县| 四会市| 靖安县|