• 在通过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. String和StringBuffer的一点研究

    转载自:http://www.cnblogs.com/heshan664754022/archive/2013/03/15/2961463.html 首先请看下下面的这几个输出的结果,请仔细考虑,不要 ...

  2. LightOJ 1284 - Lights inside 3D Grid 概率/期望/二项式定理

    题意:给你一个长宽高为x,y,z的长方体,里面每个格子放了灯,再给你k次选取任意长方体形状的区块,对其内所有灯开或关操作,初始为关,问亮灯数量的期望值. 题解:首先考虑选取区块的概率,使某个灯在被选取 ...

  3. VirtualBox4.3.12 安装ubuntu 14.04 分辨率过小(600*480)问题的解决方法

    作为.net程序员,一直都跟windows系统打交道,在同事的影响下,今天安装了Ubuntu 14. 安装完系统就遇到了这个麻烦事,找了好久才解决,因此记录下来,或许对和我一样的Ubuntu新手有帮助 ...

  4. Linux Shell下执行sqlplus

    转载自: http://www.cnblogs.com/include/archive/2011/12/30/2307889.html 以下方法解决了在linux下自动的删除创建用户 sqlplus ...

  5. JVM-内存回收算法--复制算法

    复制算法,它将堆上的内存分为两个大小相等的区域,一个是空闲区域,一个是活动区域.在程序运行中,实际使用的是活动区域,也就是有50%的空间被浪费掉. 复制算法的实现过程:1.找出活动空间中所有存活的对象 ...

  6. java 连接MySQL的代码

    1.java connect MySQL as conding. https://www.cnblogs.com/centor/p/6142775.html

  7. Tomcat的安装以及基本配置

    Tomcat是目前最常见也是最流行的基于java的一个web服务器软件   Tomcat的安装   (1)首先需要java环境,也就是说要依赖于java虚拟机JVM   (2)下载Tomcat ,地址 ...

  8. echart自定义tooltip

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. [Leetcode Week12]Unique Paths

    Unique Paths 题解 原创文章,拒绝转载 题目来源:https://leetcode.com/problems/unique-paths/description/ Description A ...

  10. 爬虫===登陆CSDN的方法

    本文主要介绍csdn的登陆,可应用在爬虫上~ # -*- coding:utf-8 -*- import json import requestsfrom xlutils.copy import co ...