关于redis集群 no reachable node in cluster的错误

代码如下
private static JedisCluster jedisCluster = null;
static{
Set nodes = new HashSet<>();
nodes.add(new HostAndPort("114.112.69.204", 7001));
nodes.add(new HostAndPort("114.112.69.204", 7002));
nodes.add(new HostAndPort("114.112.69.204", 7003));
nodes.add(new HostAndPort("114.112.69.204", 7004));
nodes.add(new HostAndPort("114.112.69.204", 7005));
nodes.add(new HostAndPort("114.112.69.204", 7006));
// 1、创建一个JedisCluster对象,构造方法,需要指定一个Set对象,set中包含HostAndPort对象。每个HostAndPort就是一个节点的地址。
jedisCluster = new JedisCluster(nodes);
/*JedisPoolConfig config = new JedisPoolConfig();
config.setMaxActive(1000);
config.setMaxIdle(300);
config.setMaxWait(10000);
config.setTestOnBorrow(false);
jedisPool =new JedisPool(config, "114.112.69.204", 6379);*/
}
@RequestMapping("/index.html")
@ResponseBody
//加入redis缓存
public Map index(HttpServletRequest request, HttpServletResponse response) throws IOException {

    Map<String, Object> result = new HashMap<String, Object>();
    ObjectMapper objectMapper = new ObjectMapper();
    IndexResult indexResult = null;
    String indexJson = jedisCluster.hget("indexResult_KEY","indexResult666");
    if (StringUtils.isNotBlank(indexJson)) {
        try {//取出redis中的数据
            indexResult = objectMapper.readValue(indexJson, IndexResult.class);
        } catch (JsonParseException e) {

            e.printStackTrace();
        } catch (JsonMappingException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }finally{
            if (jedisCluster != null) {
                jedisCluster.close();
            }
        }
在正常请求时会报错!!!!主要错误如下
严重: Servlet.service() for servlet [goutrip_api] in context with path [] threw exception [Request processing failed; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: no reachable node in cluster] with root cause

redis.clients.jedis.exceptions.JedisConnectionException: no reachable node in cluster
at redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnection(JedisSlotBasedConnectionHandler.java:54)
at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:113)
at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:131)
at redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:30)
at redis.clients.jedis.JedisCluster.hget(JedisCluster.java:361)
at com.goutrip.controller.index.IndexController.index(IndexController.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)

而使用命令行取出数据是没有问题的
![图片说明](https://img-ask.csdn.net/upload/201603/25/1458879946_317708.png)

要崩溃了啊!!!!快来救救我!!!!!!!!

问题已经解决了,就是包的冲突

图片说明

你是不是用虚拟机搭建的redis,吧虚拟机的防火请关了再试一下

是不是程序不能访问对应的服务器节点等。

运行java项目时报错,提示集群挂了。
在服务器运行redis-trib.rb check 127.0.0.1:6380进行检查

发现有报错提示:不能加载相关文件

正常的应该是:

解决方案:
先save数据再删除从节点,然后进行重启从节点实例
再次检查ok......
答案就在这里:redis集群报错:clusterdown the cluster is down
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?