Skip to content

Instantly share code, notes, and snippets.

@abhardwaj4
Created May 7, 2018 16:00
Show Gist options
  • Save abhardwaj4/2a94670b1fd90d663fb11a0754e653ae to your computer and use it in GitHub Desktop.
Save abhardwaj4/2a94670b1fd90d663fb11a0754e653ae to your computer and use it in GitHub Desktop.
Redis Cluster connect
Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
//Jedis Cluster will attempt to discover cluster nodes automatically
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7379));
JedisCluster jc = new JedisCluster(jedisClusterNodes);
jc.set("foo", "bar");
String value = jc.get("foo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment