windows版redis報(bào)錯(cuò):本地計(jì)算機(jī)上的Redis服務(wù)啟動(dòng)后停止

轉(zhuǎn):https://blog.csdn.net/pucao_cug/article/details/68951860

1問題

2 原因

3解決

3.1 如果需要臨時(shí)啟動(dòng)Redis

3.2 如果需要將Redis注冊為服務(wù)

4其他說明

?redis有windows版和linux版的,本文講的是windows版相關(guān)的一些問題。

1、問題

使用命令redis-server.exe ? --service-install ? redis.windows.conf命令將redis注冊為服務(wù),啟動(dòng)服務(wù)時(shí)報(bào)錯(cuò):


本地計(jì)算機(jī)上的Redis服務(wù)啟動(dòng)后停止。某些服務(wù)在未由其他服務(wù)或程序使用時(shí)將自動(dòng)停止。


使用命令redis-server.exe ??redis.windows.conf臨時(shí)安裝redis,結(jié)果報(bào)錯(cuò):


The Windows version of Redis allocates a memory mapped heap forsharing with

the forked process used for persistenceoperations. In order to share this

memory, Windows allocates from the systempaging file a portion equal to the

size of the Redis heap. At this time thereis insufficient contiguous free

space available in the system paging filefor this operation (Windows error

0x5AF). To work around this you may eitherincrease the size of the system

paging file, or decrease the size of theRedis heap with the --maxheap flag.

Sometimes a reboot will defragment thesystem paging file sufficiently for

this operation to complete successfully.

?

Please see the documentation included withthe binary distributions for more

details on the --maxheap flag.

?

Redis can not continue. Exiting.


如圖:

2、原因

由于沒有指定maxheap導(dǎo)致的,當(dāng)然了不指定該參數(shù)不一定報(bào)錯(cuò),但是出現(xiàn)上述原因,通常是這個(gè)原因?qū)е碌摹?/p>

3、解決

3.1、如果需要臨時(shí)啟動(dòng)Redis

使用命令:redis-server.exe? ?redis.windows.conf? ?--maxheap?200m

? ? ? ? 說明:200m是指定最大堆內(nèi)存是200m,當(dāng)然你也可以修改得在大一些

3.2、如果需要將Redis注冊為服務(wù)

? ? ? ? 如果已經(jīng)注冊為了服務(wù),先卸載掉,卸載方法是,用cmd進(jìn)入到你的redis文件的目錄,然后執(zhí)行命令:

redis-server ? ? --service-uninstall?

? ? ? ?卸載完成后,重新安裝服務(wù),執(zhí)行命令:

redis-server.exe ? --service-install ??redis.windows.conf ? ?--maxheap ?200m

說明:200m是指定最大堆內(nèi)存是200m,當(dāng)然你也可以修改得在大一些

4、其他說明

可以到github上下載最新版的redis

地址是:

https://github.com/MSOpenTech/redis/releases


windows系統(tǒng)的話,可以下載msi版直接安裝,我這里下載的是zip版,自己執(zhí)行命令來安裝

如圖:


?

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容