我正在使用Jedis使用群集功能,我正在创建群集节点并将它们添加到JedisCluster。但是,在创建JedisCluster时,将返回空的群集节点。 下面是我用Java编写的代码
Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
//Jedis Cluster will attempt to discover cluster nodes automatically
jedisClusterNodes.add(new HostAndPort("172.17.2.1", 6379));
jedisClusterNodes.add(new HostAndPort("172.17.1.2", 6379));
JedisCluster jc = new JedisCluster(jedisClusterNodes);
Map<String, JedisPool> clusterNodes = jc.getClusterNodes();