今天早上本机下测试redis时发现如下错误:
127.0.0.1:6379> set msg "message"
(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
查看日志发下如下错误:
BeginForkOperation: system error caught. error code=0x000005af, message=BeginForkOperation: VirtualProtect failed for the heap: unknown error
百度谷歌了一会,发现是maxmemory和maxheap没有设置的原因,设置如下:
maxmemory 209715200 #200MB
maxheap 314572800 #300MB maxheap=1.5*maxmemory
停止服务:
redis-server --service-stop
启动服务:
redis-server --service-start