redis-server.exe redis.windows.conf
使用上面指令啟動redis服務的時候報了以下錯誤資訊:
<code>The Windows version of Redis allocates a memory mapped heap for sharing with</code>
<code>the forked process used for persistence operations. In order to share this</code>
<code>memory, Windows allocates from the system paging file a portion equal to the</code>
<code>size of the Redis heap. At this time there is insufficient contiguous free</code>
<code>space available in the system paging file for this operation (Windows error</code>
<code>0x5AF). To work around this you may either increase the size of the system</code>
<code>paging file, or decrease the size of the Redis heap with the --maxheap flag.</code>
<code>Sometimes a reboot will defragment the system paging file sufficiently for</code>
<code>this operation to complete successfully.</code>
<code>Please see the documentation included with the binary distributions for more</code>
<code>details on the --maxheap flag.</code>
大概意思是:沒有足夠的可用空間,可以增加系統的大小分頁檔案,或減少Redis的堆的大小
使用--maxheap标志。
有時重新開機将充分整理系統分頁檔案(重新開機可以解決)
可以再啟動指令後面加maxheap參數重新配置設定堆大小。
redis-server.exe redis.windows.conf --maxheap 200m
http://sanwen8.cn/p/1a3gMDZ.html
[1944] 14 Oct 10:01:31.577 #
The Windows version of Redis allocates a large memory mapped file for sharing
the heap with the forked process used in persistence operations. This file
will be created in the current working directory or the directory specified by
the 'heapdir' directive in the .conf file. Windows is reporting that there is
insufficient disk space available for this file (Windows error 0x70).
You may fix this problem by either reducing the size of the Redis heap with
the --maxheap flag, or by moving the heap file to a local drive with sufficient
space.
Please see the documentation included with the binary distributions for more
details on the --maxheap and --heapdir flags.
Redis can not continue. Exiting.
RedisQFork_4328.dat
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIn5GcuYzM0cDZyYjYjlDOwMGOmJjYjhTNlZzYlVWMycjZlZjMfdWbp9CXt92Yu4GZjlGbh5SZslmZxl3Lc9CX6MHc0RHaiojIsJye.png)
啟動windows版本的Redis會在C槽建立一個RedisQFork打頭的檔案,改變存放位置的辦法:
在redis.windows.conf下更改參數heapdir為./,表示是在目前目錄
啟動redis伺服器:run.bat
Redis是可以安裝成windows服務的,開機自啟動
但是安裝好之後,Redis并沒有啟動,啟動指令如下:
redis-server --service-start
停止指令:
redis-server --service-stop
還可以安裝多個執行個體
redis-server --service-install –service-name redisService1 –port 10001
redis-server --service-start –service-name redisService1
redis-server --service-install –service-name redisService2 –port 10002
redis-server --service-start –service-name redisService2
redis-server --service-install –service-name redisService3 –port 10003
redis-server --service-start –service-name redisService3
解除安裝指令:
redis-server --service-uninstall
最後提示一下:2.8版本的不支援32位系統,32位系統要去下載下傳2.6版本的。2.6版本的無法像上面一樣友善的部署,它提供一個叫RedisWatcher的程式來運作redis server,Redis停止後會自動重新開機。
另外推薦一個Redis可視化管理工具:Redis Desktop Manager,官網的下載下傳位址被牆了,可以在我的網盤下載下傳 v0.7.6版
http://keenwon.com/1275.html