官网地址:https://redis.io/download

官方安装文档如下:

Installation

Download, extract and compile Redis with:

$ wget http://download.redis.io/releases/redis-4.0.10.tar.gz
$ tar xzf redis-4.0.10.tar.gz
$ cd redis-4.0.10
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server

You can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

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.

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

# bind 127.0.0.1 

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

daemonize yes

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

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

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

  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】【报错】redis.exceptions.ResponseError: DENIED Redis is running in protected mode

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

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

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

随机推荐

  1. 快速实现抖音的分享&登录(android)

    快速实现抖音分享与第三方登录 准备工作 1.注册抖音的key到抖音开放平台,点击这里查看步骤: 2.集成ShareSDK到Mob官网文档页面查看即可,点击这里查看集成: 业务代码 分享要求: 视频: ...

  2. n2n网络环境搭建

    目的:   实现家中nas,在任何环境ssh访问 方案:n2n v1 (原因稳定&兼容macbook) 开源地址: https://svn.ntop.org/svn/ntop/trunk/n2 ...

  3. Python学习笔记:基础

    本文根据廖雪峰的博客,学习整理笔记.主要内容有:基本数据类型,容器数据类型,变量及其作用域,判断及循环语法,函数式编程,面向对象,模块等概念. 数据类型 在python中,能够直接处理的数据类型有以下 ...

  4. Jenkins构建maven项目跳过测试用例的命令

    在Jenkins构建项目的时候,有时候执行大量的单元测试用例需要浪费很多时间,又或者测试环境与其他dubbo,zookeeper服务器环境不通执行失败, 为了更快速的构建,可在build选项中使用如下 ...

  5. TestNG的使用方法

      本文转载自于:https://blog.csdn.net/qq_24373725/article/category/7432624       TestNG介绍 TestNG是Java中的一个测试 ...

  6. java开发师笔试面试每日12题(1)

    1.什么是Java虚拟机?为什么Java被称作是“平台无关的编程语言”?Java虚拟机是一个可以执行Java字节码的虚拟机进程.Java源文件被编译成能被Java虚拟机执行的字节码文件.Java被设计 ...

  7. Java 包与类的命名(util、service、tool、dao )区别

    util 通用的.与业务无关的,可以独立出来,可供其他项目使用.方法通常是public static,一般无类的属性,如果有,也是public static. service 与某一个业务有关,不是通 ...

  8. 探寻TP-Link路由器的登录验证

    提示:该案例仅供学习使用,切勿滥用!!! 查找路由器连接地址 查找ip $ ifconfig enp2s0: flags=<UP,BROADCAST,RUNNING,MULTICAST> ...

  9. Xamarin常见问题

    1. Could not locate Java 6 or 7 SDK. (Download from http://www.oracle.com/technetwork/java/javase/do ...

  10. 利用Python+163邮箱授权码发送邮件

    背景 前段时间写了个自动打卡的脚本,但是脚本不够完善,我需要知道,打卡到底成没成功,因此,我想到了用Python执行完代码之后,再执行一段发送邮件的代码.需求开始明确了,就开始分析和写代码实现吧. 分 ...