redis常见问题

1. 使用Jedis连接的时候没有返回pong , 可能是因为防火墙没有关闭 , 把redis的端口加入到/ect/sysconfig/initables中

2. 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.大意为:(错误)misconf redis被配置以保存数据库快照,但misconf redis目前不能在硬盘上持久化。用来修改数据集合的命令不能用,请使用日志的错误详细信息。
解决方案: 运行 config set stop-writes-on-bgsave-error no 命令 ; 关闭配置项stop-writes-on-bgsave-error解决该问题。
或者以root用户登录,启动redis服务器

3. WRONGTYPE Operation against a key holding the wrong kind of value表示的意思是这个key对应的类型,不支持此操作

4. Failed Opening .rdb for saving:Permission denied. Background saving error ;根据错误提示,是Redis后台保存时遭遇了权限问题。

在终端中打开redis.conf文件,redis.conf
在redis.conf文件中搜索dir的配置项,dir配置项是rdb文件保存的目录,dir ./

    # 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 ./

查看权限
$ ls -l
….
-rw-r–r–. 1 root root 35 Aug 4 00:59 dump.rdb
….
此处dump.rdb文件root账号是有读写权限,而同为管理员组的其他账号之后读权限,所以造成了上诉问题

修改文件权限:
$ chmod g+w dump.rdb
此处./表示redis-server所在的目录,查看该目录的权限

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值