萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> 解決redis 無法啟動的問題

解決redis 無法啟動的問題

redis 無法啟動怎麼辦呢,我們直接通過命令方式來啟動嗎,今天小編來為各位說說關於redis 無法啟動的問題了,希望文章能夠幫助到各位同學的哦。

redis突然掛掉後,無法啟動,查看log日志,發現報Short read or OOM loading DB. Unrecoverable error, aborting now
解決辦法:

[root@localhost ~]# rm -f /var/lib/redis/dump.rdb 
[root@localhost ~]# rm -f /var/run/redis.pid 
[root@localhost ~]# service redis start 


問題二

The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
 
Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

    大概意思是:沒有足夠的可用空間,可以增加系統的大小分頁文件,或減少Redis的堆的大小
使用--maxheap標志

有時重啟將充分整理系統分頁文件(重啟可以解決)
可以再啟動命令後面加maxheap參數重新分配堆大小。

redis-server.exe redis.windows.conf --maxheap 200m


問題三

redis配置錯誤導致服務器不能啟動

redis-server忘了把配置裡面的daemonize的no改成yes
所以把redis-server加入到了/etc/rc.local裡面,在服務器啟動的時候就會阻塞在這裡,導致服務器不能啟動。
[解決方案]
使用GRUB時,可以添加一個S(大寫S)到內核命令行,可以進入單用戶模式。
要做到這樣, 需要重新起動系統,當GRUB的屏幕出現時:

1、使用方向鍵選擇你希望引導的內核。
2、按下e鍵以編輯這個命令行。
3、選擇以單詞kernel起頭的這行。
4、按下e鍵以編輯這個命令行。
5、在行末添加一個字母S
6、回車接受改動。
7、按b鍵接受修改並且啟動內核。
這樣就會進入單用戶模式,可以在bash下執行命令。
此時 進入 /etc/rc.local把文件修改回來

刪除其中的這兩行
redis-server /home/redis/redis.conf
rabbitmq-server

 

copyright © 萬盛學電腦網 all rights reserved