1. 程式人生 > >redis報錯解決

redis報錯解決

1、Connecting to node 127.0.0.17000 [ERR] Sorry, can't connect to node 192.168.1.917000

redis叢集:Connecting to node 127.0.0.1:7000: [ERR] Sorry, can't connect to node 192.168.1.91:7000
2016年12月17日 01:29:53
閱讀數:6168
Connecting to node 127.0.0.1:7000: [ERR] Sorry, can't connect to node 192.168.1.91:7001

這個錯誤的話那就檢視下你6個埠是否都啟動了,沒啟動的話會報上面的錯誤

 

2、error) NOAUTH Authentication required.

 

出現認證問題,應該是設定了認證密碼,輸入密碼既可以

方法一、

127.0.0.1:6379> auth "yourpassword"
例如密碼是‘root’,當出現認證問題時候,輸入“auth ‘root’”即可


127.0.0.1:6379> set name "fish"
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth "root"
127.0.0.1:7000> auth joinu_1233
OK


方法二、


[[email protected] conf]# redis-cli -c -p 7000 -a joinu_1233
127.0.0.1:7000> set name fish
-> Redirected to slot [5798] located at 127.0.0.1:7002
OK
127.0.0.1:7002>

 

 

3、redis停止報錯


Redis 停止時出現: (error) NOAUTH Authentication required.
複製程式碼
[email protected]:~# /etc/init.d/redis_6379 stop
Stopping ...
(error) NOAUTH Authentication required.
Waiting for Redis to shutdown ...
Waiting for Redis to shutdown ...

解決:

停止時要加登陸時密碼。
[[email protected] conf]# redis-cli -c -p 7000 -a joinu_1233 shutdown
[[email protected] conf]# redis-cli -c -p 7000
Could not connect to Redis at 127.0.0.1:7000: Connection refused
Could not connect to Redis at 127.0.0.1:7000: Connection refused
not connected>

 

 

4、redis遠端連線以及注意事項

[[email protected] ~]# ps -ef | grep redis
  root 2175 1 0 08:15 ? 00:00:05 /usr/local/bin/redis-server *:6379


  /usr/local/bin/redis-server *:6379 中通過"*"就可以看出此時是允許所有的ip連線登入到這臺redis服務上。

 

redis-cli -h 192.168.43.75 -p 6379 -a ilanniredis

 

 

5、reidis叢集報錯

[[email protected] src]# ./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.3:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
報錯:[ERR] Sorry, can't connect to node 172.0.0.0:7000
解決:重啟centos系統,親測,網上的都試過,沒有用

 

6、在k8s裡面連線redis報錯

# redis-cli -h 10.104.130.187
Could not connect to Redis at 10.104.130.187:6379: No route to host
Could not connect to Redis at 10.104.130.187:6379: No route to host


解決:

把endpoint 的地址改成內網地址即可

 


7、k8s中連線redis錯誤: java.lang.NumberFormatException: For input string: "[email protected]"

把java配置檔案中的埠寫死,寫成 6379

參考地址:https://blog.csdn.net/murongxuesheng/article/details/81562846