您好,登錄后才能下訂單哦!
環(huán)境:3.0.7 redis八節(jié)點(diǎn)集群4主4從 開發(fā)測試環(huán)境
操作:清除集群持久化數(shù)據(jù)
#redis-cli -c -p 6383 -h 172.31.103.238 登陸之后
cluster nodes 察看節(jié)點(diǎn)信息 登陸master節(jié)點(diǎn)進(jìn)行刪除 flushall
在其中一個(gè)節(jié)點(diǎn)執(zhí)行時(shí)抱錯(cuò):
172.31.103.238:6383> flushdb
(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
網(wǎng)上信息:
今天運(yùn)行Redis時(shí)發(fā)生錯(cuò)誤,錯(cuò)誤信息如下:
(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
Redis被配置為保存數(shù)據(jù)庫快照,但它目前不能持久化到硬盤。用來修改集合數(shù)據(jù)的命令不能用。請查看Redis日志的詳細(xì)錯(cuò)誤信息。
原因:
強(qiáng)制關(guān)閉Redis快照導(dǎo)致不能持久化。
解決方案:
運(yùn)行config set stop-writes-on-bgsave-error no 命令后,關(guān)閉配置項(xiàng)stop-writes-on-bgsave-error解決該問題。
root@ubuntu:/usr/local/redis/bin# ./redis-cli
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK
127.0.0.1:6379> lpush myColour "red"
(integer) 1
察看自己配置文件:
stop-writes-on-bgsave-error yes
雖然是測試環(huán)境但是沒有立刻修改,登陸到相應(yīng)節(jié)點(diǎn)上
df -h 察看root滿了
[root@VM-172-31-103-238 /]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 35G 35G 0 100% /
查找到罪魁禍?zhǔn)资情_發(fā)搞的日志文件33g
確認(rèn)之后刪除之
刪除之后察看
[root@VM-172-31-103-238 /]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 35G 35G 0 100% /
沒有釋放
[root@VM-172-31-103-238 /]#lsof | grep delete
java 21037 root 1w REG 252,3 35273113600 395356 /opt/server/logs/catalina.out (deleted)
java 21037 root 2w REG 252,3 35273113600 395356 /opt/server/logs/catalina.out (deleted)
[root@VM-172-31-103-238 /]#kill -9 21037
[root@VM-172-31-103-238 /]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 35G 2.0G 32G 6% /
再次執(zhí)行
[root@VM-172-31-103-73 /cluster]#redis-cli -c -p 6383 -h 172.31.103.238
172.31.103.238:6383> flushall
OK
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。