import java.util.HashSet;
import java.util.Set;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;
public class TestMe {
public static void main(String args[])
{
Set sentinels=new HashSet
();
sentinels.add(new HostAndPort(“127.0.0.1”,26379).toString());
sentinels.add(new HostAndPort(“127.0.0.1”,36379).toString());
JedisSentinelPool sentinelPoll=new
JedisSentinelPool(“mymaster”,sentinels
);
System.out.println(sentinelPoll.getCurrentHostMaster().toString());
System.out.println(“ok…”);
Jedis master=sentinelPoll.getResource();
//master.set(“son”, “liuxueyuan”);
System.out.println(master.get(“son”));
master.close();
sentinelPoll.destroy();
}
}