Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JedisCluster with password exception #1165

Closed
pythoner02 opened this issue Nov 27, 2015 · 10 comments
Closed

JedisCluster with password exception #1165

pythoner02 opened this issue Nov 27, 2015 · 10 comments

Comments

@pythoner02
Copy link

First, please forgive my English is poor.

I use redis3.0.5 and jedis2.7.2.
redis cluster mode with requirepass open.

Here are my code:
JedisCluster jedisCluster = new JedisCluster(nodes); jedisCluster.auth("bar");

and it throws an exception :
redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.

Please tell me how to use password with redis cluster.

Thank you!

@marcosnils
Copy link
Contributor

@pythoner02 You can't because Redis cluster doesn't support it. Check https://groups.google.com/forum/#!searchin/redis-db/password/redis-db/Z8lMxTfDct8/fQY8slgbkYYJ for further info.

@mp911de
Copy link
Contributor

mp911de commented Feb 4, 2016

Wanted to ping you that Redis Cluster works with authentication (using requirepass and AUTH). Using different passwords on the particular nodes might be an overkill but if the password is always the same, it's working quite nicely.

@marcosnils
Copy link
Contributor

@mp911de I was aware that you can set a password individually to all Redis Cluster nodes, the thing is that all the official tools around like redis-trib or create-cluster don't support setting the password to do the administrative stuff. When we asked about this in the redis mailing list (link above) antirez replied that they didn't think of a proper password strategy for Redis Cluster and that it was still using the traditional not-very-secure method.

The reason why we didn't add this to JedisCluster is because based on the thread comments we have the impression that password in RC still haven't been totally polished and that it's probably that they might change in the future. That's why we were holding on this, because it seems like it's something that very few people need and the redis collaborators still haven't decide how to properly implement it in a clustered environment

@bingge1
Copy link

bingge1 commented May 18, 2016

I Rewrite the source code.

@marcosnils
Copy link
Contributor

?

@TimLovellSmith
Copy link

@marcosnils @mp911de @pythoner02 May I suggest opening this issue again? Azure redis supports cluster but always requires password authentication, even with cluster.

@marcosnils
Copy link
Contributor

@TimLovellSmith this has been submitted as a PR here: #1269

@soulsoul
Copy link

soulsoul commented Jul 1, 2016

   i'm using redis 3.2.1 Cluster on server-side .now for security, we must set password for all

redis's client connections. (set masterauth and requirepass in the cluster config files). as we know,
the redis official cluster created by ruby script named "ruby-trib.rb" . but, it does not work well so
we should modify the rubygem file to add the cluster password. then the script can create cluster
successfully avoid the error as follow:

Creating cluster

[ERR] Sorry, can't connect to node 192.168.1.100:6379.

then, i want to ask that does jedis support connecting to redis-cluster-model server with password ?which jedis version is recommend ?

@marcosnils
Copy link
Contributor

@soulsoul jedis 2.9 and master (3.0) support password authentication in cluster. Releases are not ready yet but you can easily build jar from sources.

@soulsoul
Copy link

@marcosnils thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants