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 loopback 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 '--protected-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的保护模式开启了,并且没有绑定ip地址,没有密码认证

2. 解决方案
方案一:

1) 使用 设置CONFIG SET protected-mode no

步骤:

1. 在redis本机上打开redis-cli工具,并连接

2. 在其中输入CONFIG SET protected-mode no即可

缺点:

该种方式只是短暂性有效,如果redisServer重新启动后还是不能正常链接

方案二:

1)编辑redis配置文件,将保护模式关闭

步骤:

由于我是直接使用redis-server 命令启动的,所以说其服务是按照其默认设置进行启动,修改/usr/local/etc/redis.conf

如果没有请从下载的redis中复制一个redis.conf到这里,

将bind 后面绑定的ip后面加入你本机外网的ip

bind 127.0.0.1 192.168.21.4

  

然后保存,再使用redis-server /usr/local/etc/redis.conf启动

问题:

  1.redis-cli不能直接使用,必须输入绑定的ip+d端口号才能正常使用

  2.不安全

2). 将redis.conf中安全模式关闭

将该保护模式改为no

再试

缺点:1.保护模式关闭后不安全

3)设置密码访问模式

在redis.conf中加入一行密码设置

require 你的密码

保存,再重新启动redis客户端

以上四种方式解决该错误都可以,但是根据上面的优缺点,

选择第四种方式最佳,安全性最高 

解决使用jedis连接是报DENIED Redis is running in protected mode错误的更多相关文章

  1. 2017.7.10 Redis报错:DENIED Redis is running in protected mode

    参考来自: java 客户端链接不上redis解决方案 DENIED Redis is running in protected mode 完整错误信息: Caused by: redis.clien ...

  2. springboot2集成redis5报错:io.lettuce.core.RedisException: io.lettuce.core.RedisConnectionException: DENIED Redis is running in protected

    报错信息如下: Caused by: io.lettuce.core.RedisException: io.lettuce.core.RedisConnectionException: DENIED ...

  3. error) DENIED Redis is running in protected mode because protected mode is enabled报错

    官网地址:https://redis.io/download 官方安装文档如下: Installation Download, extract and compile Redis with: $ wg ...

  4. DENIED Redis is running in protected mode

    1.开源软件往往做的非常出色,错误的时候,会告诉你原因,以及怎么修改,仔细阅读就能明白.比如这个错误: [root@localhost src]# ./redis-cli -h 172.16.2.16 ...

  5. Redis异常 | DENIED Redis is running in protected mode because protected mode is enabled

    背景 今天重新搭了个redis环境,用简单的代码去测试下是否正常, @RunWith(SpringRunner.class) @SpringBootTest public class Springbo ...

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

    在通过Java程序链接配置好的redis服务时出现 DENIED Redis is running in protected mode because protected mode is enable ...

  7. DENIED Redis is running in protected mode because protected mode is enabled

    DENIED Redis is running in protected mode because protected mode is enabled redisson连接错误 Unable to i ...

  8. 关于Jedis连接Linux上的redis出现 DENIED Redis is running in protected mode问题的解决方案

    redis 添加了requirepass 123456后还是报错,原来是重新启动的时候./redis-cli  没有指定配置文件. https://blog.csdn.net/a532672728/a ...

  9. 【Redis】【报错】redis.exceptions.ResponseError: DENIED Redis is running in protected mode

    (一)报错前提 写flask 项目的时候,因为连接了私有云中的redis地址指定了IP host,启动项目的时候报错 (二)解决方法 首先要切换到root用户 root@:/etc/redis# pw ...

随机推荐

  1. 微信QQ打开网页时提示用浏览器打开

    微信QQ打开网页时提示用浏览器打开 一,需求分析 1.1,使用微信或QQ打开网址时,无法在微信或QQ内打开常用下载软件,手机APP等.故此需要在微信qq里提示 二,功能实现 2.1 html实现 &l ...

  2. 一条SQL语句执行得很慢的原因有哪些?(转)

    一条 SQL 语句执行的很慢,那是每次执行都很慢呢?还是大多数情况下是正常的,偶尔出现很慢呢?所以我觉得,我们还得分以下两种情况来讨论. 1.大多数情况是正常的,只是偶尔会出现很慢的情况. 2.在数据 ...

  3. CART算法与剪枝原理

    参考:https://blog.csdn.net/u014688145/article/details/53326910 知乎:https://www.zhihu.com/question/22697 ...

  4. 老男孩python学习自修第十五天【常用模块之time】

    例如: #!/usr/bin/env python # _*_ coding:UTF-8 _*_ import time if __name__ == "__main__": pr ...

  5. SpringMVC中对多部件类型解析---文件(图片)上传

    加入上传图片jar包 commons-io-2.4.jar commons-fileupload-1.3.jar 在页面form中提交enctype="multipart/form-data ...

  6. Lodop打印控件 超文本自动分页

    Lodop打印控件打印html超文本,通常传入一个超文本内容可能会超过纸张,如果要拆分每页显示哪些然后手动分页比较麻烦,Lodop中的超文本都有自动分页的特点.自动分页的依据:1.超文本超过设置的打印 ...

  7. jQuery 操作Cookie

    一个轻量级的cookie 插件,可以读取.写入.删除 cookie. 下载地址:http://plugins.jquery.com/cookie/ (在实际中可以用这个保存cookie保存用户的习惯, ...

  8. Pulse-per-second (PPS) Signal Interfacing

    Some radio clocks and related timekeeping gear have a pulse-per-second (PPS) signal that can be used ...

  9. 前端动态属性页面的 要用id做name 因为这样方便在提交表单时候取到值

    前端动态属性页面的 要用id做name 因为这样方便在提交表单时候取到值

  10. JAVA web 使用有盟推送总结

    仔细阅读文档,下边的都是废话. 为了省事,iOS和Android 提供了所有了参数,需要那个了修改传参. //ios actionURL为自定义参数 $.ajax({ type : "POS ...