README.md in redis-5.0.7 vs README.md in redis-5.0.8
- old
+ new
@@ -118,22 +118,42 @@
connect to. The list does not need to enumerate all your Sentinel instances,
but a few so that if one is down the client will try the next one. The client
is able to remember the last Sentinel that was able to reply correctly and will
use it for the next requests.
-If you want to [authenticate](https://redis.io/topics/sentinel#configuring-sentinel-instances-with-authentication) Sentinel itself, you must specify the `password` option per instance.
+To [authenticate](https://redis.io/docs/management/sentinel/#configuring-sentinel-instances-with-authentication) Sentinel itself, you can specify the `sentinel_username` and `sentinel_password`. Exclude the `sentinel_username` option if you're using password-only authentication.
```ruby
-SENTINELS = [{ host: '127.0.0.1', port: 26380, password: 'mysecret' },
- { host: '127.0.0.1', port: 26381, password: 'mysecret' }]
+SENTINELS = [{ host: '127.0.0.1', port: 26380},
+ { host: '127.0.0.1', port: 26381}]
-redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, role: :master)
+redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, sentinel_username: 'appuser', sentinel_password: 'mysecret', role: :master)
```
-Also the name can be passed as an url:
+If you specify a username and/or password at the top level for your main Redis instance, Sentinel *will not* using thouse credentials
```ruby
-redis = Redis.new(name: "redis://mymaster", sentinels: SENTINELS, role: :master)
+# Use 'mysecret' to authenticate against the mymaster instance, but skip authentication for the sentinels:
+SENTINELS = [{ host: '127.0.0.1', port: 26380 },
+ { host: '127.0.0.1', port: 26381 }]
+
+redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, role: :master, password: 'mysecret')
+```
+
+So you have to provide Sentinel credential and Redis explictly even they are the same
+
+```ruby
+# Use 'mysecret' to authenticate against the mymaster instance and sentinel
+SENTINELS = [{ host: '127.0.0.1', port: 26380 },
+ { host: '127.0.0.1', port: 26381 }]
+
+redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, role: :master, password: 'mysecret', sentinel_password: 'mysecret')
+```
+
+Also the `name`, `password`, `username` and `db` for Redis instance can be passed as an url:
+
+```ruby
+redis = Redis.new(url: "redis://appuser:mysecret@mymaster/10", sentinels: SENTINELS, role: :master)
```
## Cluster support
[Clustering](https://redis.io/topics/cluster-spec). is supported via the [`redis-clustering` gem](cluster/).