1. 程式人生 > >Caused by: redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected m

Caused by: redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected m

問題描述:


java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:779) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760
) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:747) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.5.3.RELEASE.jar:1.5
.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] at org.tyrone.springboot.integrate.redis.Application.main(Application.java:27
) [classes/:na] Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: 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.; nested exception is redis.clients.jedis.exceptions.JedisDataException: 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. at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:64) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.connection.jedis.JedisExceptionConverter.convert(JedisExceptionConverter.java:41) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:37) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.connection.jedis.JedisConnection.convertJedisAccessException(JedisConnection.java:242) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.connection.jedis.JedisConnection.exists(JedisConnection.java:815) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.connection.DefaultStringRedisConnection.exists(DefaultStringRedisConnection.java:264) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate$6.doInRedis(RedisTemplate.java:661) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate$6.doInRedis(RedisTemplate.java:658) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:207) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:169) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate.hasKey(RedisTemplate.java:658) ~[spring-data-redis-1.8.3.RELEASE.jar:na] at org.tyrone.springboot.integrate.redis.Application.run(Application.java:20) [classes/:na] at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:776) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE] ... 6 common frames omitted Caused by: redis.clients.jedis.exceptions.JedisDataException: 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. at redis.clients.jedis.Protocol.processError(Protocol.java:127) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Protocol.process(Protocol.java:161) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Protocol.read(Protocol.java:215) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.Connection.getIntegerReply(Connection.java:265) ~[jedis-2.9.0.jar:na] at redis.clients.jedis.BinaryJedis.exists(BinaryJedis.java:279) ~[jedis-2.9.0.jar:na] at org.springframework.data.redis.connection.jedis.JedisConnection.exists(JedisConnection.java:813) ~[spring-data-redis-1.8.3.RELEASE.jar:na] ... 14 common frames omitted 2017-06-12 16:25:38.729 INFO 5540 --- [ main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot[email protected]56928307: startup date [Mon Jun 12 16:25:31 CST 2017]; root of context hierarchy 2017-06-12 16:25:38.731 INFO 5540 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown

解決方案:
這個問題是由於redis沒有配置密碼的原因導致的,只需要為redis設定密碼即可。
設定密碼方法:

127.0.0.1:6379> config get requirepass
1) "requirepass"
2) ""
127.0.0.1:6379> config set requirepass "admin"
OK

config get requirepass: 這是查詢redis是否配置密碼,如果返回為空,則表明未配置密碼。
config set requirepass “admin”這是將redis的密碼設定為“admin”

相關推薦

Caused by: redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected m

問題描述: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.ca

redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

今天執行專案,redis突然出現以下問題: redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able t

redis.clients.jedis.exceptions.JedisDataException :READONLY You can't write

錯誤 red can exception conf readonly 分布 span app 分布式直連同步調用測試時出現的錯誤:主從復制架構下,默認Slave是只讀的,如果寫入則會報錯: redis.clients.jedis.exceptions.JedisDataEx

redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of argum

最近在公司一個防重加鎖中用了redis的msetnx 執行時報錯如上圖 看錯誤大概就是引數有問題,可變引數,傳的沒問題啊。。。找到報錯堆疊 大概就是解析資料的時候報錯了,而資料來源就是入參的資料 想到可能是可變引數的問題,隨後傳入兩個引數嘗試,發現沒有問題,之前只有一個引

redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set

使用哨兵模式連線redis連線池時,遇到錯誤: Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set 發現是re

使用redis做一次投票活動中tomcat 啟動一段時間後宕機redis.clients.jedis.exceptions.JedisDataException: value sent to redi

一個微信投票活動中專案扔tomcat中跑起來 ,後來投票後不間斷老司機,當時十分費解  ,小專案沒用日誌略坑,只能檢視tomcat日誌,於是看到日誌記錄報錯如下 Jun 17, 2017 7:52:53 AM org.apache.catalina.core.Standar

redis儲存tomcat共享session異常:redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication

最近專案中用到redis儲存tomcat共享session。不知什麼原因出現異常。問題解決了,做一下記錄:  異常資訊---使用者資訊入庫異常:{"accessToken":"2.00YFIXBEb2qQtBf4e0393a1cKTFFeD","expireIn":"63

redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.

在用jedis叢集中,用ShardedJedisPool對主從進行hash演算法選取redis服務端,然而我在redis主從都設定了密碼,在配置連線時報如下錯誤  at redis.clients.jedis.Protocol.processError(Protocol.

redis.clients.jedis.exceptions.JedisException: Can connect to sentinel, but seems to be not monitored.

在使用Redis的哨兵Sentinel配置時,報錯如下: redis.clients.jedis.exceptions.JedisException: Can connect to sentinel, but myMaster seems to be not monitored. 報錯原因: 可能是因為

redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect ti

  redis連線報錯: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out 開啟防火牆(systemctl

redis 連線失敗redis.clients.jedis.exceptions.JedisConnectionException

23-Apr-2018 16:08:57.647 嚴重 [RMI TCP Connection(5)-127.0.0.1] org.springframework.web.servlet.FrameworkServlet.initServletBean Context initialization

liunx 叢集錯誤 redis.clients.jedis.exceptions.JedisNoReachableClusterNode No reachable node in cluster

Exception in thread "main" redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException: No reachable node in clusterat redis.clie

redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException

如果使用java連線不上redis伺服器 請先檢視是否啟動了redis伺服器: 如果啟動之後仍然報錯,請使用下面的解決方法: 解決辦法一: 1.關閉防火牆: 檢視防火牆狀態: /etc/i

Jedis連結Vm虛擬機器中Redis時,Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionExcepti

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out at

redis異常解決 :idea啟動本地redis出現 jedis.exceptions.JedisDataException: NOAUTH Authentication required

第一次安裝在本地redis服務,試試跑專案,結果卻出現nested exception is redis.clients.jedi

關於Jedis連線Linux上的redis出現 DENIED Redis is running in protected mode問題的解決方案

  最近有段時間沒有寫部落格了,今天抽出時間寫寫,之前開發的時候redis部署在Linux是其他人搞得,我沒怎麼參與,於是閒

Redis Sentinel配置使用過程中的一個坑(DENIED Redis is running in protected mode)

        根據官網示例配置完sentinel.conf,大致新增如下配置項: port 26379 sentinel monitor mymaster 172.17.16.7 6379 2 sentinel auth-pass mymaster

redis 錯誤 Error reply to PING from master: '-DENIED Redis is running in protected mode because prote

做主從的時候,碰到下面問題 Error reply to PING from master: ‘-DENIED Redis is running in protected mode because p

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

本文轉載自:http://news.tuxi.com.cn/news/16541999999012402/4020207.html 在應用上telnet埠和ping都沒有問題,為什麼還獲取不到值呢。 先安裝一個redis客戶端進行測試:yum -y install r

Spring 整合 Redis報錯 DENIED Redis is running in protected mode because protected mode is enabled, no b

Spring 整合 Redis報錯 DENIED Redis is running in protected mode because protected mode is enabled, no bind address was sp… 1.因為是第一次