• 在通过Java程序链接配置好的redis服务时出现 DENIED Redis is running in protected mode because protected mode is enabled 异常。
  • Redis protected-mode 是3.2 之后加入的新特性,在Redis.conf的注释中,我们可以了解到,他的具体作用和启用条件。
    (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.

    是说处于保护模式,只能本地链接,我们需要修改配置文件../redis.conf

解决方案:
  1)打开配置文件把下面对应的注释掉

# bind 127.0.0.1

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

protected-mode no 

  3)保护模式

protected-mode no 

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

redis-server redis.conf

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

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

原文地址:http://blog.csdn.net/Agly_Clarlie/article/details/52251746

(error) DENIED Redis is running in protected mode because protected mode is enabled的更多相关文章

  1. 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 ...

  2. DENIED Redis is running in protected mode

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

  3. 解决使用jedis连接是报DENIED Redis is running in protected mode错误

    DENIED Redis is running in protected mode because protected mode is enabled, no bind address was spe ...

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

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

  5. 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 ...

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

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

  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. Redis报错:DENIED Redis is running in protected mode

    转:Redis使用认证密码登录   Redis默认配置是不需要密码认证的,也就是说只要连接的Redis服务器的host和port正确,就可以连接使用.这在安全性上会有一定的问题,所以需要启用Redis ...

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

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

随机推荐

  1. 自定义函数,根据p个数,自适应剧中效果

    //最后投保进程line-height 自适应居中; function self_adaption(){ $('.last_place').each(function(){ var _this = $ ...

  2. Hadoop 介绍

    1.Hadoop简介 Hadoop[hædu:p]实现了一个分布式文件系统(Hadoop Distributed File System),简称HDFS.HDFS有高容错性的特点,并且设计用来部署在低 ...

  3. HDU 5868 Different Circle Permutation Burnside引理+矩阵快速幂+逆元

    题意:有N个座位,人可以选座位,但选的座位不能相邻,且旋转不同构的坐法有几种.如4个座位有3种做法.\( 1≤N≤1000000000 (10^9) \). 题解:首先考虑座位不相邻的选法问题,如果不 ...

  4. Item 29 优先考虑类型安全的异构容器

    集合API展示了泛型的一般用法.但是它们(Set,HashMap,Map)限制了每个容器只能有固定数目的类型参数.     比如Set集合,HashMap集合: import java.util.Ha ...

  5. 2016-2017 2 20155335《java程序设计》第四周总结

    #  20155335    <Java程序设计>第四周学习总结 ##  教材学习内容总结 继承,在本职上是特殊到一般的关系,即is—a关系,子类继承父类,表明子类是一种特殊的父类,并且具 ...

  6. bzoj 1503 平衡树

    我们可以用一颗平衡树维护每个人的工资,因为工资的变化会影响到后面所有的人,所以我们打一个标签,向平衡树里插入的时候减去这个标签的值,这样代表改变了之后的零点,,这样维护这个标签就好了,输出的时候要加上 ...

  7. C# 获取一段日期内的工作日

    /// <summary> /// 根据指定时间段计算工作日天数 /// </summary> /// <param name="firstDay"& ...

  8. windows下 nginx安装 使用

    介绍 Nginx (engine x) 是一个高性能的HTTP和反向代理服务器. 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络 ...

  9. canvas_基于canvan绘制的双半圆环进度条

    效果图 实现原理: 1.使用canvas绘制两个半圆弧,底图灰色半圆弧和颜色进度圆弧. 2.利用setInterval计时器,逐步改变颜色进度条,达到进度条的效果. 效果代码: <!DOCTYP ...

  10. js_layer弹窗的使用和总结

    2018-04-10 一张呈现给用户的网页,会有很多种交互,比如连不上网络,用户点击按钮时向后台请求数据不成功等等.像这些情况,用户是看不见的, 要给用户更好的体验,在特定的时间,给客户反馈内容.实时 ...