Jedis auth with JedisCluster or JedisPool

2,091 views
Skip to first unread message

junzo...@gmail.com

unread,
Jul 8, 2016, 3:19:26 PM7/8/16
to Jedis
Hello, 

I have three Redis nodes and I want to use them a single entity with password auth. 

I am currently using JedisCluster by passing the set of three Redis Nodes. But JedisCluster does not support password auth yet, right?

How should I proceed? 

this is what I am doing: 

      JedisPool pool = new JedisPool(rd.host, rd.port);

      //pool.addObjects(1);

      jedis = pool.getResource();

      jedis.auth("W4LFU00O12");

if JedisPool is the only option, how do I add my second and third node into the JedisPool? 


Thanks. 


Jun

Jonathan Leibiusky

unread,
Jul 8, 2016, 3:24:05 PM7/8/16
to Jedis
Hi!

Auth in RedisCluster is something that is not well supported.

So yeah. JedisCluster doesn't support auth request to every node in the cluster. You'd have to do it yourself.

--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcos Lilljedahl

unread,
Jul 8, 2016, 4:00:01 PM7/8/16
to Jedis

Actually, Jedis support auth to RedisCluster in 2.9 and master branch. We'll soon release the official versions so you can use it from the maven repo

https://github.com/xetorthio/jedis/blob/master/src/test/java/redis/clients/jedis/tests/JedisClusterTest.java#L161

https://github.com/xetorthio/jedis/pull/1269

sent from mobile

Jonathan Leibiusky

unread,
Jul 8, 2016, 7:28:02 PM7/8/16
to Jedis

OK. I don't like this feature. But it is there ready and people seem to need it even if redis community is not convinced about how useful it is.

So long story short, if you need it before jedis 2.9 you'll have to do it yourself. Otherwise, wait for 2.9 and Jedis will do it for you.

Marcos Lilljedahl

unread,
Jul 8, 2016, 7:33:41 PM7/8/16
to Jedis

I don't like the feature either as Redis Cluster doesn't define how to handle global auth. The thing is that several cloud providers create Redis Cluster with a password and they couldn't use it without Jedis unless we implemented this.

sent from mobile

Jonathan Leibiusky

unread,
Jul 8, 2016, 7:45:01 PM7/8/16
to Jedis

Just wondering... Which are those cloud providers?

Marcos Lilljedahl

unread,
Jul 8, 2016, 7:50:50 PM7/8/16
to Jedis

Azure is one of them

sent from mobile

junzo...@gmail.com

unread,
Jul 8, 2016, 7:57:48 PM7/8/16
to Jedis
thank you all for your replies. :)
Reply all
Reply to author
Forward
0 new messages