一、异常说明
在进行redis5.0集群配置后,通过java示例代码进行连接测试验证报"redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException: No reachable node in cluster"异常,详情日志如下>>
Exception in thread "main" redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException: No reachable node in cluster@b@ at redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnection(JedisSlotBasedConnectionHandler.java:61)@b@ at redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnectionFromSlot(JedisSlotBasedConnectionHandler.java:78)@b@ at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:102)@b@ at redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:25)@b@ at redis.clients.jedis.JedisCluster.set(JedisCluster.java:112)@b@ at com.xwood.redis.cluster.JedisClusterTest.main(JedisClusterTest.java:25)
二、解决方法
主要因redis集群配置文件redis.conf配置文件中"bind 127.0.0.1"修改具体本地ip地址如"bind 192.168.1.204" (完整详细配置步骤参见”redis集群配置..示例代码“文章)
[root@centos-cluster-s19423 redis-cluster-conf]# vi /home/app/redis5/redis-cluster-conf7001/redis.conf@b@...@b@#bind 127.0.0.1@b@bind 192.168.1.204@b@...