我是靠谱客的博主 深情纸鹤,这篇文章主要介绍(error) DENIED Redis is running in protected mode because protected mode is enabled,现在分享给大家,希望可以做个参考。

redis踩坑:(error) DENIED Redis is running in protected mode because protected mode is enabled

场景:阿里云上部署了redis,也配置了redis.conf

  • 注释掉绑定ip
    # bind 127.0.0.1
  • Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程,设置为no
    daemonize no
  • 保护模式,关闭保护模式,否则外部ip无法连接
    protected-mode no

以上设置完成后,进入redis/bin目录,重启redis,命令

./redis-server

启动springboot项目,依然报错,使用Redis Desktop Manager依然连接不上。

查找后发现redis.conf虽然设置了,但是并没有重启。
所以需要真正的和配置文件启动需要:
./redis-server redis.conf
再次连接redis,成功,启动项目,成功。

其他硬知识

  • 查看redis进程是否存在
    ps -ef |grep redis
  • 检测6379端口是否在监听
    netstat -lntp | grep 6379
  • 停止redis,使用control+c快捷键或者使用客户端 redis-cli shutdown

最后

以上就是深情纸鹤最近收集整理的关于(error) DENIED Redis is running in protected mode because protected mode is enabled的全部内容,更多相关(error)内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(128)

评论列表共有 0 条评论

立即
投稿
返回
顶部