当前位置: 首页 > news >正文

redis 报错 Redis protected-mode 配置文件没有真正启动

(error) DENIED Redis is running in protected mode because protected mode is enabled

  • Redis protected-mode 是3.2 之后加入的新特性,在Redis.conf的注释中,我们可以了解到,他的具体作用和启用条件

链接redis 时只能通过本地localhost (127.0.0.1)这个来链接,而不能用网络ip(192.168…)这个链接,问题然如果用网络ip 链接会报以下的错误:

(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the lookback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the --portected-mode no option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.1

是说处于保护模式,只能本地链接,我们需要修改配置文件…/redis.conf
1)打开配置文件把下面对应的注释掉

# bind 127.0.0.1 1

2)Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程,设置为no

daemonize no1

3)保护模式

protected-mode no 1

4)最后关键的是:
没反应应该是你启动服务端的时候没有带上配置文件。你可以./redis-server redis.conf
你配置好了,但要重新启动redis,如果还是报一样的错误,很可能是没有启动到配置文件,所以需要真正的和配置文件启动需要:
在redis.conf文件的当前目录下:

$ redis-server redis.conf1

如果还是所某个端口已在使用,那么可能是有 后台程序在占用该端口,需要kill 掉该程序,重新带上配置文件。./redis-server redis.conf启动。
将含有”redis”关键词的进程杀死:

$ ps -ef | grep redis | awk ‘{print $2}| xargs kill -91

我的问题就是这个步骤解决的,祝好。

转载至:https://blog.csdn.net/Agly_Clarlie/article/details/52251746

http://www.lryc.cn/news/163458.html

相关文章:

  • 解决a标签内容中img标签和p标签垂直方向间隔太大的问题
  • 如何选择靠谱的全景平台?VR全景加盟从哪方面对比?
  • CentOS系统环境搭建(十八)——CentOS7安装Docker20.10.12和docker compose v2
  • NebulaGrap入门介绍和集群安装部署
  • thinkphp5.0 composer 安装oss提示php版本异常
  • AList dokcer安装及百度网盘挂载
  • whereIn 遇到了最大限制,临时表处理方式
  • 基于SSM的校园快递代取系统设计与实现
  • MySQL事务详细讲解
  • [linux] mmcv-full 安装的时候 Building wheel 卡住
  • Python怎么实现更高效的数据结构和算法? - 易智编译EaseEditing
  • 03-zookeeper节点动态上下线案例
  • 如何使用TensorFlow完成线性回归
  • @controller和@RestController的区别
  • GeoNet: Unsupervised Learning of Dense Depth, Optical Flow and Camera Pose 论文阅读
  • 蓝桥杯官网填空题(振兴中华)
  • node基础之七:Mongodb 数据库
  • 基于Python和mysql开发的智慧校园答题考试系统(源码+数据库+程序配置说明书+程序使用说明书)
  • OPPO/真我手机ColorOS13系统解账户锁-移除手机密码图案锁方法
  • 阿里云大数据实战记录9:MaxCompute RAM 用户与授权
  • JavaScript基础07——变量拓展-数组
  • go-zerogo web集成redis实战
  • 油猴浏览器(安卓)
  • Redis 6.0多线程模型比单线程优化在哪里了
  • [hello,world]这个如何将[ ] 去掉
  • 机器学习_个人笔记_周志华(更新中......)
  • 嵌入式Linux驱动开发(LCD屏幕专题)(二)
  • React的jsx的用法
  • Ei Scopus检索 | 2024年第四届能源与环境工程国际会议(CoEEE 2024)
  • 习题练习 C语言(暑期第四弹)