/**
* 集群版
*/
@Test
public void JedisJiuQun()
{
HashSet<HostAndPort> nodes=new HashSet<>();
nodes.add(new HostAndPort("192.168.1.191",7001));
nodes.add(new HostAndPort("192.168.1.191",7002));
nodes.add(new HostAndPort("192.168.1.191",7003));
nodes.add(new HostAndPort("192.168.1.191",7004));
nodes.add(new HostAndPort("192.168.1.191",7005));
nodes.add(new HostAndPort("192.168.1.191",7006));
JedisCluster clu=new JedisCluster(nodes);
clu.set("chb1","fffff");
String s=clu.get("chb1");
System.out.println(s);
clu.close();
}
jedis连接集群
荣耀存于心,而非留于形我还在寻找,回家的路长路漫漫,唯剑做伴且随疾风前行,身后一许流星吾虽浪迹天涯, 却未迷失本心