Redis service failed to start ——解决方法

错误信息

运行命令启动 redis 服务: redis-server.exe --service-start --service-name redisserver1时,失败

错误信息:Redis service failed to start.

查看日志信息:dbfilename can't be a path, just a filename


解决

  • 打开 redis.windows-service.conf 文件(如果你的 redis 不是以这个配置文件启动的,就打开另外一个 redis.windows.conf 文件
  • 根据日志,是 dbfilename 出了问题,翻译过来就是 dbfilename 不能是一个路径,只能是一个文件名
  • 我的 conf 文件一开始是这样配置的:本意是想让 dbfilename 放在 redis_data/ 路径下。查阅了一些博客了解到,dbfilename 的路径其实就是相对于 dir 路径的。即:dir 已经明确了其他文件放置的相对位置
  • 换句话说,如果是 dir ./xxxx ,则 dbfilename ss.rdb 就表示把 dbfilename 放在 ./xxxx/ss.rdb 下了,无需再写 path(这也符合日志的信息),相当于 dbfilename 仅仅是用来给持久化文件取名字的,而不是确定位置的
# The filename where to dump the DB
dbfilename ./redis_data/dump.rdb

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./redis_data

至此,问题解决

如果你的问题还未解决,那么就打开日志文件,根据日志报错信息继续查下去即可。加油,陌生人

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值