JedisCluster连接redis-cluster集群报错

java.lang.NumberFormatException: For input string: "7002@17002"


at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at redis.clients.util.ClusterNodeInformationParser.getHostAndPortFromNodeLine(ClusterNodeInformationParser.java:38)
at redis.clients.util.ClusterNodeInformationParser.parse(ClusterNodeInformationParser.java:14)
at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:43)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:52)
at redis.clients.jedis.JedisClusterConnectionHandler.(JedisClusterConnectionHandler.java:37)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.(JedisSlotBasedConnectionHandler.java:16)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:48)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:35)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:27)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:31)

at com.taotao.content.service.TestJedis.testJedisCluster(TestJedis.java:71)


原因:

    使用2.7.2redis-client版本过低

解决方法:

    redis-client改为2.9.0

        

           redis.clients

           jedis

           2.9.0

       


    


你可能感兴趣的:(编程偶遇BUG)