Skip to content

Instantly share code, notes, and snippets.

@tdooner
Last active October 14, 2022 12:12
Show Gist options
  • Save tdooner/53e62737af2c2a72f5d7 to your computer and use it in GitHub Desktop.
Save tdooner/53e62737af2c2a72f5d7 to your computer and use it in GitHub Desktop.
Sidekiq Redis Sentinel configuration
# config/initializers/sidekiq.rb
Sidekiq.configure_client do |config| # and repeat this inside a Sidekiq.configure_server
config.redis = {
master_name: 'your-master-name',
sentinels: [
"sentinel://sentinel01.example.com:26379",
"sentinel://sentinel02.example.com:26379",
"sentinel://sentinel03.example.com:26379",
],
failover_reconnect_timeout: 20, # roughly 3-5 seconds longer than the sentinel failover-timeout
namespace: 'your-namespace', # optional
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment