環境:3.0.7 redis八節點集群4主4從 開發測試環境
操作:清除集群持久化數據
#redis-cli -c -p 6383 -h 172.31.103.238 登陸之后
cluster nodes 察看節點信息 登陸master節點進行刪除 flushall
在其中一個節點執行時抱錯:
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.
網上信息:
今天運行Redis時發生錯誤,錯誤信息如下:
(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被配置為保存數據庫快照,但它目前不能持久化到硬盤。用來修改集合數據的命令不能用。請查看Redis日志的詳細錯誤信息。
原因:
強制關閉Redis快照導致不能持久化。
解決方案:
運行config set stop-writes-on-bgsave-error no 命令后,關閉配置項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
雖然是測試環境但是沒有立刻修改,登陸到相應節點上
df -h 察看root滿了
[root@VM-172-31-103-238 /]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 35G 35G 0 100% /
查找到罪魁禍首是開發搞的日志文件33g
確認之后刪除之
刪除之后察看
[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% /
再次執行
[root@VM-172-31-103-73 /cluster]#redis-cli -c -p 6383 -h 172.31.103.238
172.31.103.238:6383> flushall
OK
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。