-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cannot connect to password-authenticated sentinels #76
Comments
I'm not sure. I don't have sentinels set up myself, so not sure how to debug the issue. But one thing you could do is to set the MOJO_REDIS_DEBUG environment variable to 1 instead of using strace. I think that will make it easier to understand what is going on. |
OK, here you are:
|
If you want to reproduce this yourself, a minimal one-server one-sentinel configuration is the following:
Let me know if you need anything more to reproduce this. |
@jhthorsen: did you have time to look at this? Thanks! |
Fix for jhthorsen#76 : When connecting to sentinels and sending get-master-addr-by-name query, the Mojo::Promise object should be bound to the Mojo::Redis' own ioloop, otherwise it is not fulfilled and the ->then() callback is not called. Despite originally reported as authentication problem in jhthorsen#76, sentinel connection does not work at all, even when no authentication is set up. A minimal test case: $ cat redis.conf port 7000 $ cat sentinel.conf port 7001 sentinel monitor mymaster 127.0.0.1 7000 1 sentinel down-after-milliseconds mymaster 60000 $ redis-server ./redis.conf & $ redis-sentinel ./sentinel.conf & $ perl -MRedis -E 'my $r = Redis->new(service=>"mymaster", sentinels=>["127.0.0.1:7001"]); $r->set("/test" => 42, EX => 100); say $r->get("/test")' 42 $ MOJO_REDIS_DEBUG=1 perl -MMojo::Redis -E 'my $r = Mojo::Redis->new("redis://mymaster?sentinel=127.0.0.1:7001"); $r->db->set("/test" => 42); say $r->db->get("/test");'
Fix for #76 : When connecting to sentinels and sending get-master-addr-by-name query, the Mojo::Promise object should be bound to the Mojo::Redis' own ioloop, otherwise it is not fulfilled and the ->then() callback is not called. Despite originally reported as authentication problem in #76, sentinel connection does not work at all, even when no authentication is set up. A minimal test case: $ cat redis.conf port 7000 $ cat sentinel.conf port 7001 sentinel monitor mymaster 127.0.0.1 7000 1 sentinel down-after-milliseconds mymaster 60000 $ redis-server ./redis.conf & $ redis-sentinel ./sentinel.conf & $ perl -MRedis -E 'my $r = Redis->new(service=>"mymaster", sentinels=>["127.0.0.1:7001"]); $r->set("/test" => 42, EX => 100); say $r->get("/test")' 42 $ MOJO_REDIS_DEBUG=1 perl -MMojo::Redis -E 'my $r = Mojo::Redis->new("redis://mymaster?sentinel=127.0.0.1:7001"); $r->db->set("/test" => 42); say $r->db->get("/test");'
Hello!
I am trying to connect to a set of password-authenticated sentinels using the following connect string:
Accordng to strace, Mojo::Redis connects and authenticates itself to the sentinel, but then gets stuck probably waiting for more data, even though according to strace the respolse is complete:
(addresses and passwords edited, so the actual bytes read do not match). Could it be that Mojo::Redis expects some more data from sentinel?
The following code using Redis.pm works:
Thanks!
-Yenya
The text was updated successfully, but these errors were encountered: