ruby on rails - "No sentinels available." Error when running sidekiq with redis -
i'm trying connect rails app redis sentinel.
it works when connecting single redis master, keep getting "no sentinels available." error when trying connect sentinel.
i have 1 master redis on port 6379, , slave on 6380 , 1 on 6381.
running 3 sentinels, configs like(each different port , master port):
port 16379 sentinel monitor mymaster 127.0.0.1 6379 2 sentinel down-after-milliseconds mymaster 5000 sentinel failover-timeout mymaster 60000
here sidekiq.rb:
redis_connection = proc { redis.current = redis.new( master_name: "mymaster", sentinels: [ { host: '<my_ip>', port: 16379 }, { host: '<my_ip>', port: 16380 }, { host: '<my_ip>', port: 16381 }, ], url: "redis://<my_ip>:6379/0" ) } sidekiq.configure_server |config| config.redis = connectionpool.new(size: 10, &redis_connection) end sidekiq.configure_client |config| config.redis = connectionpool.new(size: 10, &redis_connection) end
so if remove in sentinels array, work connection 6379 master, breaks when trying sentinels.
i able connect sentinles using redis-cli , debug , information them.
Comments
Post a Comment