解决使用jedis连接是报DENIED Redis is running in protected mode错误
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错误的更多相关文章
- 2017.7.10 Redis报错:DENIED Redis is running in protected mode
参考来自: java 客户端链接不上redis解决方案 DENIED Redis is running in protected mode 完整错误信息: Caused by: redis.clien ...
- 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 ...
- 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 ...
- DENIED Redis is running in protected mode
1.开源软件往往做的非常出色,错误的时候,会告诉你原因,以及怎么修改,仔细阅读就能明白.比如这个错误: [root@localhost src]# ./redis-cli -h 172.16.2.16 ...
- Redis异常 | DENIED Redis is running in protected mode because protected mode is enabled
背景 今天重新搭了个redis环境,用简单的代码去测试下是否正常, @RunWith(SpringRunner.class) @SpringBootTest public class Springbo ...
- (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 ...
- 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 ...
- 关于Jedis连接Linux上的redis出现 DENIED Redis is running in protected mode问题的解决方案
redis 添加了requirepass 123456后还是报错,原来是重新启动的时候./redis-cli 没有指定配置文件. https://blog.csdn.net/a532672728/a ...
- 【Redis】【报错】redis.exceptions.ResponseError: DENIED Redis is running in protected mode
(一)报错前提 写flask 项目的时候,因为连接了私有云中的redis地址指定了IP host,启动项目的时候报错 (二)解决方法 首先要切换到root用户 root@:/etc/redis# pw ...
随机推荐
- jenkins 插件介绍
1.jenkins 利用maven编译,打包,所需插件:Maven Integration: Maven集成插件这个插件提供了Jenkins和Maven的深度集成,无论是好还是坏:项目之间的自动触发取 ...
- Mybatis 配置resultMap一对多关联映射
resultMap配置: 引用: PO类: 接口: 测试: public class UserMapperTest { private SqlSessionFactory sqlSessionFact ...
- centOS7搭建NFS服务器
借鉴别人这篇博客搭建成功的:http://blog.51cto.com/mrxiong2017/2087001 NFS系统:用来共享文件.图片.视频 准备两个centOS7服务器,一个作NFS ser ...
- 【gedit】 显示行号
打开gedit文本编辑器->Edit(编辑)->preferences(预设)->view(视图)->在Display line numbers前打勾->close
- php的amqp扩展 安装(windows) rabbitmq学习篇
因为RabbitMQ是由erlang语言实现的,所以先要安装erlang环境erlang 下载安装 http://www.erlang.org/download.htmlrabbitmq 下载安装 h ...
- Linux基础学习(13)--Linux系统管理
第十三章——Linux系统管理 一.进程管理 1.进程查看: (1)进程简介:进程是正在执行的一个程序或命令,每一个进程都是一个运行的实体,都有自己的地址空间,并占用一定的系统资源. (2)进程管理的 ...
- qtp 自动化测试--点滴 自定义显示工具菜单 trzedit
tools-customize-toolbars-勾选后关闭 2 trzedit 使用winobject 方法取值 Window("驷惠WIN系列[汽车4S连锁管理软件] 6.") ...
- C#中decimal,double和float的区别
float 单精度浮点 32bit,double 双精度浮点64bit,decimal是高精度 128bit,浮点型.float double 是 基本类型(primitive type),decim ...
- HJ212 CRC 16 (C#)
算法 CRC16 校验寄存器赋值为 0xFFFF: 取被校验串的第一个字节赋值给临时寄存器: 临时寄存器与 CRC16 校验寄存器的高位字节进行"异或"运算,赋值给 CRC16 校 ...
- [开源 .NET 跨平台 Crawler 数据采集 爬虫框架: DotnetSpider] [一] 初衷与架构设计
[DotnetSpider 系列目录] 一.初衷与架构设计 二.基本使用 三.配置式爬虫 四.JSON数据解析与配置系统 五.如何做全站采集 为什么要造轮子 同学们可以去各大招聘网站查看一下爬虫工程师 ...