(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 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

时间: 2024-11-03 19:04:05

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

DENIED Redis is running in protected mode

1.开源软件往往做的非常出色,错误的时候,会告诉你原因,以及怎么修改,仔细阅读就能明白.比如这个错误: [[email protected] src]# ./redis-cli -h 172.16.2.16 -p 6379 172.16.2.16:6379> get name (error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specif

redis解决(DENIED Redis is running in protected mode because prote)

早上一个应用日志打印报错信息: 在应用上telnet端口和ping都没有问题,为什么还获取不到值呢. 先安装一个redis客户端进行测试:yum -y install redis redis-cli -h 192.168.32.12 -p 6887 然后就报错了: (error) DENIED Redis is running in protected mode because protected mode is-- 后来就查看配置发现redis.conf 该行也是注释的: # requirep

Redis报错:DENIED Redis is running in protected mode

Redis默认配置是不需要密码认证的,也就是说只要连接的Redis服务器的host和port正确,就可以连接使用.这在安全性上会有一定的问题,所以需要启用Redis的认证密码,增加Redis服务器的安全性. 1. 修改配置文件 Redis的配置文件默认在/etc/redis.conf,找到如下行: #requirepass foobared 去掉前面的注释,并修改为所需要的密码: requirepass myPassword (其中myPassword就是要设置的密码) 2. 重启Redis 如

(error) MISCONF Redis is configured to save RDB snapshots, but is currently

项目执行删除Redis缓存时发生错误,错误信息如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Redis被配置为保存数据

(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.

今天运行Redis时发生错误,错误信息如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Redis被配置为保存数据库快照,

(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t

运行redis过程中,突然报错如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. 解决方案(百度到的答案,不过确实有用):

iOS 添加 Watch OS 1 应用后无法运行 An error was encountered while running (Domain = LaunchServicesError, Code = 0)

在 iOS 应用基础上我添加了一个 Watch OS 2 应用,运行良好.又加了一个 Watch OS 1 应用,然后就所有 Target 都不能运行了. 运行时说 An error was encountered while running (Domain = LaunchServicesError, Code = 0) 原因 : 在 iOS 应用 Target -> General -> Embedded Binaries 发现新创建的 Watch OS 1 应用的 Target 被加在这

【iOS开发-27】解决方案:An error was encountered while running(Domain=FBSOpenApplicationErrorDomain, Code=4)

iOS simulator出现问题,提示: An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4) 解决方案: [iOS Simulator] >>> [Rest Contents and Settings...] >>> [Reset] 参考:解决问题

iOS An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)

新建了一个项目发现模拟器只有iPhone6,于是添加了其余的模拟器 但是在运行项目的时候出现An error was encountered while running(Domain=LaunchSerivcesError, Code=0) 解决办法是重启模拟器 点击模拟器菜单中的Reset Contents and Settings,完成后,再运行就OK了!