windows版redis報錯:本地計算機上的Redis服務啓動後停止

轉載:http://blog.csdn.net/pucao_cug/article/details/68951860

       Redis有windows版和Linux版的,本文講的是windows版相關的一些問題。

1、問題

使用命令redis-server.exe   --service-install   redis.windows.conf命令將redis註冊爲服務,啓動服務時報錯:

 

本地計算機上的Redis服務啓動後停止。某些服務在未由其他服務或程序使用時將自動停止

 

   使用命令redis-server.exe   redis.windows.conf臨時安裝redis,結果報錯:

 

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導致的,當然了不指定該參數不一定報錯,但是出現上述原因,通常是這個原因導致的。

3、解決

3.1、如果需要臨時啓動Redis

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

        說明:200m是指定最大堆內存是200m,當然你也可以修改得在大一些

3.2、如果需要將Redis註冊爲服務

        如果已經註冊爲了服務,先卸載掉,卸載方法是,用cmd進入到你的redis文件的目錄,然後執行命令:

redis-server     --service-uninstall 

       卸載完成後,重新安裝服務,執行命令:

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

說明:200m是指定最大堆內存是200m,當然你也可以修改得在大一些

4、其他說明

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

地址是:

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

 

windows系統的話,可以下載msi版直接安裝,我這裏下載的是zip版,自己執行命令來安裝

如圖:

 

 


1問題

2 原因

3解決

      3.1 如果需要臨時啓動Redis

      3.2 如果需要將Redis註冊爲服務

4其他說明

       Redis有windows版和Linux版的,本文講的是windows版相關的一些問題。

1、問題

使用命令redis-server.exe   --service-install   redis.windows.conf命令將redis註冊爲服務,啓動服務時報錯:

 

本地計算機上的Redis服務啓動後停止。某些服務在未由其他服務或程序使用時將自動停止

 

   使用命令redis-server.exe   redis.windows.conf臨時安裝redis,結果報錯:

 

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導致的,當然了不指定該參數不一定報錯,但是出現上述原因,通常是這個原因導致的。

3、解決

3.1、如果需要臨時啓動Redis

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

        說明:200m是指定最大堆內存是200m,當然你也可以修改得在大一些

3.2、如果需要將Redis註冊爲服務

        如果已經註冊爲了服務,先卸載掉,卸載方法是,用cmd進入到你的redis文件的目錄,然後執行命令:

redis-server     --service-uninstall 

       卸載完成後,重新安裝服務,執行命令:

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

說明:200m是指定最大堆內存是200m,當然你也可以修改得在大一些

4、其他說明

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

地址是:

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

 

windows系統的話,可以下載msi版直接安裝,我這裏下載的是zip版,自己執行命令來安裝

如圖:

 

 

 

 

   

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章