解決redis在linux重啟就資料丟失問題

2022-08-30 17:24:08 字數 400 閱讀 5517

在linux系統中,redis本來是有資料的,但在linux系統重啟後,redis中的資料全部丟失。經過幾次測試都一樣,只有在linux系統重啟才會丟失,redis重啟應該是沒有問題的。

這個問題只在linux系統才存在,在windows系統是沒有問題的。

二、解決方案

在linux系統設定乙個引數(vm.overcommit_memory)即可解決。

步驟如下:

1、編輯 sysctl.conf 配置檔案

vi /etc/sysctl.conf

2、另起一行增加引數 vm.overcommit_memory 配置,如下

vm.overcommit_memory = 1

3、使配置檔案生效

sysctl -p

linux 重啟redis 命令

redis已經加入到etc下也就是伺服器啟動redis 也啟動。突然發現連不上redis 所以上來看看 檢視redis 狀態 systemctl status redis redis.service redis server loaded loaded usr lib systemd system ...

redis集群在mac本地重啟

1 首先進入切換管理員模式 sudo su 輸入密碼進入 2 進入redis的cluster裡面把 刪除nodes conf配置檔案,刪除pid檔案,刪除各節點aof,rdb檔案,殺掉所有redis程序 3 然後進行重啟 cd usr local etc cluster redis server 7...

在linux上重啟nginx

nginx目錄 etc nginx conf.d conf.d包含了nginx的配置 service nginx start 重啟 如果報以下錯 今天重啟10伺服器nginx,報 nginx emerg bind to 0.0.0.0 8995 failed 13 permission denied...