Closed alexesDev closed 5 years ago
Could you inform me of your environment?
4.1.1
?password
option in the client?requirepass
and masterauth
options in the servers?sentinel auth-pass
option in the sentinel nodes?Are you using the client version 4.1.1? Yes
bundle list | grep redis
* redis (4.1.1)
What the managed Redis server's version is? redis_version:5.0.4
Are you specifying the password option in the client? Yes
Sidekiq.configure_server do |config|
config.redis = {
url: 'redis://my-instance-name',
password: 'my-password',
sentinels: [{ host: ..., port: ... }],
}
end
4 and 5. I cannot see config files.
Сonnection instructions for other languages
#!/bin/bash
host=$(redis-cli -h ****.mdb.yandexcloud.net -p 26379 sentinel get-master-addr-by-name my-instance name | head -n 1)
redis-cli -h $host -a %(password) ping
const Redis = require('ioredis');
const redis = new Redis({
sentinels: [
{host: '***.mdb.yandexcloud.net', port: 26379}
],
name: 'my-instance',
password: '<password>',
role: 'master'
});
redis.set('foo', 'bar');
Managed Service for Redis guarantees operation only with certain DBMS clients, but you are free to use other clients without restrictions.
The following clients are supported:
No | Sentinel Auth | Master or Slave Auth | redis-rb |
---|---|---|---|
1 | enabled | enabled | The client works fine only if both passwords are same. |
2 | enabled | disabled | There might be no use case. |
3 | disabled | enabled | There is a bug. |
4 | disabled | disabled | The client works fine. |
I guess your env might be No.3.
I think it might be better to separate the password option into 2 types like as follows. (feature request)
sentinels = [{ host: '127.0.0.1', port: 6400, password: 'foo' },
{ host: '127.0.0.1', port: 6401, password: 'foo' }]
redis = Redis.new(host: 'mymaster', sentinels: sentinels, role: :master, password: 'bar')
or
sentinels = [{ host: '127.0.0.1', port: 6400 },
{ host: '127.0.0.1', port: 6401 }]
redis = Redis.new(host: 'mymaster', sentinels: sentinels, role: :master, sentinel_password: 'foo', password: 'bar')
But we are able to take workaround with error handling like your gist.
I tried to use https://cloud.yandex.com/docs/managed-redis/ and got
ERR Client sent AUTH, but no password is set
becousesentinel get-master-addr-by-name
must be call without password.Is this a bug?
Monkey patch: https://gist.github.com/alexesDev/5b0fe8006775cb27a877b5a3766465c9