Jedis Cluster common problems jedisclusterexception:clusterdown the cluster is down

Source: Internet
Author: User
Tags redis

The error is shown below and no reason has been found so far. Ask the great God to help answer, what is the cause of the error, what is the solution.


Redis.clients.jedis.exceptions.hk.JedisClusterException:CLUSTERDOWN the cluster is down at Redis.clients.jedis.hk.Protocol.processError (protocol.java:118) at Redis.clients.jedis.hk.Protocol.process ( protocol.java:138) at Redis.clients.jedis.hk.Protocol.read (protocol.java:207) at Redis.clients.jedis.hk.Connection.readProtocolWithCheckingBroken (connection.java:285) at Redis.clients.jedis.hk.Connection.getIntegerReply (connection.java:210) at Redis.clients.jedis.hk.Jedis.hset ( jedis.java:664) at Redis.clients.jedis.hk.jediscluster$24.execute (jediscluster.java:306) at Redis.clients.jedis.hk.jediscluster$24.execute (jediscluster.java:303) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries (jedisclustercommand.java:60) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries (jedisclustercommand.java:71) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries (jedisclustercommand.java:86) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries (jedisclustercommand.java:71) AT Redis.clients.jedis.hk.JedisClusterCommand.run (jedisclustercommand.java:32) at Redis.clients.jedis.hk.JedisCluster.hset (jediscluster.java:302) at Com.iclick.shard.CommonProgram.commonProgram ( commonprogram.java:57) at Com.iclick.shard.ShardProgram0.run (shardprogram0.java:43) at Java.lang.Thread.run ( thread.java:745) Redis.clients.jedis.exceptions.hk.JedisClusterException:CLUSTERDOWN The cluster is down at Redis.clients.jedis.hk.Protocol.processError (protocol.java:118) at Redis.clients.jedis.hk.Protocol.process ( protocol.java:138) at Redis.clients.jedis.hk.Protocol.read (protocol.java:207) at Redis.clients.jedis.hk.Connection.readProtocolWithCheckingBroken (connection.java:285) at Redis.clients.jedis.hk.Connection.getIntegerReply (connection.java:210) at Redis.clients.jedis.hk.Jedis.hset ( jedis.java:664) at Redis.clients.jedis.hk.jediscluster$24.execute (jediscluster.java:306) at Redis.clients.jedis.hk.jediscluster$24.execute (jediscluster.java:303) at Redis.clients.jedis.hk.JedisClusterCommaNd.runwithretries (jedisclustercommand.java:60) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries ( jedisclustercommand.java:71) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries ( jedisclustercommand.java:86) at Redis.clients.jedis.hk.JedisClusterCommand.runWithRetries ( jedisclustercommand.java:71) at Redis.clients.jedis.hk.JedisClusterCommand.run (jedisclustercommand.java:32) at Redis.clients.jedis.hk.JedisCluster.hset (jediscluster.java:302) at Com.iclick.shard.CommonProgram.commonProgram ( commonprogram.java:57) at Com.iclick.shard.ShardProgram0.run (shardprogram0.java:43) at Java.lang.Thread.run ( thread.java:745) Redis.clients.jedis.exceptions.hk.JedisClusterException:CLUSTERDOWN The cluster is down at Redis.clients.jedis.hk.Protocol.processError (protocol.java:118) at Redis.clients.jedis.hk.Protocol.process ( protocol.java:138) at Redis.clients.jedis.hk.Protocol.read (protocol.java:207) at 

The code is as follows:

Public staticvoid Main (String[]args) {

Filecount.splitfile (10);

set

Set.add (New Hostandport ("127.0.0.1", 7000));

Set.add (New Hostandport ("127.0.0.1", 7001));

Set.add (New Hostandport ("127.0.0.1", 7002));

Set.add (New Hostandport ("127.0.0.1", 7003));

Set.add (New Hostandport ("127.0.0.1", 7004));

Set.add (New Hostandport ("127.0.0.1", 7005));

Jediscluster Jedis =new jediscluster (set, 5000, 1000);


BufferedReader Reader =null;

try {

for (intcount_i = 0;count_i < 10;count_i++) {

String fileName = file.separator + "Users" + file.separator

+ "Lishangrong" + file.separator + "XMO"

+ File.separator + "20150525_" +count_i;

File file =new file (fileName);

reader = new BufferedReader (new FileReader (file));

String tempstring =null;

Jsonobject JSON;

List<string> label;

List<string> gender;

List<string> age;

Read one line at a time, the file ends when you read null

while ((TempString =reader.readline ())!=null) {

JSON = new Jsonobject ();

label = new Arraylist<string> ();

gender = new Arraylist<string> ();

Age = new arraylist<string> ();

Show the current line number

String[] Split =tempstring.split ("\\s");

String Cookie =split[0];

if (!split[1].split (",") [0].equals ("N")) {

String[] lsbellist =split[1].split (",");

for (inti = 0;i <lsbellist.length;i++) {

Label.

Label.add (Lsbellist[i]);

}

}

Gender

if (!split[2].equals ("N")) {

Gender.add (split[2]);

}

Age

if (!split[3].equals ("N")) {

Age.add (Split[3]);

}

Json.put ("label", label);

Json.put ("Gender", gender);

Json.put (' age ', age);

String jsonstr =json.tostring ();

Jedis.hset ("Group_" +cookie, "features", JSONSTR);


}

JSON = NULL;

label = NULL;

gender = null;

age = null;

File.delete ();

}

Long L2 = System.currenttimemillis ();

System.out.println (L2-L1);

} catch (Exceptione) {

E.printstacktrace (PW);

Mailsend.mail_send (Sw.tostring ());

finally {

if (reader!=null) {

try {

Reader.close ();

} catch (IOExceptione1) {

}

}

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.