-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add supoort to Redis Cluster password,and add auth in php.ini #902
Conversation
Our team currently also needs this function. I have test your code,generally it works,wakaka. But I have two little suggestions: 1)using 'estrdup' to get a copy of auth string instead of using ecalloc and memcpy, otherwise, it may results in error in 'cmd_len = redis_cmd_format_static(&cmd, "AUTH", "s", redis_sock->auth, strlen(redis_sock->auth));' sentence of resend_auth procedure(strlen(redis_sock->auth) may be greater than original auth string's length); 2) return NULL instead of -1 in the first 'if' branch of 'cluster_get_slots' procedure may be better. |
I was a novice for redis and now I am tring to use redis cluster with password. Thanks for your code, but I find no example to use your code, can you teach me how to connect to redis cluster with password in PHP? c is very difficult for me. @andyli029 |
@waxdsf I'm not the author of this pull request, but from looking at the code it appears that it adds an argument which will come right after your seeds array, which is just a string (the password). |
@michael-grunder Thanks for your answer. I forget to restart php-fpm so that when I second install phpredis, so it does not work with password. I made a stupid mistake, it works well now. Anyway, thank you! |
How can I set a password for a cluster? |
Is it possible to specify in the seed string? |
the simple example:
the password is “9MEL1CDSYY” |
Ah, so the method signature changes from: new RedisCluster(null, $seeds, $timeout, $readTimeout, $persistent) to the new one: new RedisCluster(null, $seeds, $password, $timeout, $readTimeout, $persistent) Correct? |
You are right! |
@JacketWoo @yatsukhnenko Thanks for your suggestions. |
@andyli029, I'm not really familiar with cluster so it will be better if @michael-grunder will review/merge |
@andyli029 I'll test it locally but it looks good on first glance. The only issue I see is that it changes the argument order of |
@michael-grunder
is changed to
or how to modify? |
Aha, I must have been looking at an old version On Mon, Aug 22, 2016, 10:59 PM andyli notifications@github.com wrote:
|
@michael-grunder please review and merge the commit. |
When it will be merged? I really would like to have this feature in your official release. |
@michael-grunder Any ideas when this PR will be merged? |
Closing in favour to #1363 |
Add supoort to Redis Cluster password, but not support Redis Cluster password added in php.ini temporarily