redis-2-在windows中安装redis和客户端管理工具
1 安装redis
(1)安装
安装包Redis-x64-3.0.504.msi
安装路径D:\Program Files\Redis
设置环境变量D:\Program Files\Redis
(2)启动
进入安装目录
CMD>redis-server.exe redis.windows.conf关闭命令行窗口就是关闭 redis。
(3)可以通过服务进行启动
此电脑->右键->管理->服务->redis
2 安装redis客户端
安装包redis-desktop-manager-0.8.8.384.exe
3 问题及解决方案
StackExchange.Redis.RedisServerException:“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.”
究其原因是因为强制把redis快照关闭了导致不能持久化的问题,在网上查了一些相关解决方案,通过stop-writes-on-bgsave-error值设置为no即可避免这种问题。
有两种修改方法,一种是通过redis命令行修改,另一种是直接修改redis.conf配置文件
命令行修改方式示例:
在安装目录中运行redis-cli.exe
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
修改redis.conf文件:vi打开redis-server配置的redis.conf文件,然后使用快捷匹配模式:/stop-writes-on-bgsave-error定位到stop-writes-on-bgsave-error字符串所在位置,接着把后面的yes设置为no即可。
Windows在文件redis.windows.conf中和redis.windows-service.conf中更改
修改完成后,重启redis服务。