Created
May 7, 2018 16:00
-
-
Save abhardwaj4/2a94670b1fd90d663fb11a0754e653ae to your computer and use it in GitHub Desktop.
Redis Cluster connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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