Skip to content

Commit

Permalink
Clarify sentinel constructor parameters
Browse files Browse the repository at this point in the history
Fix: #1188
  • Loading branch information
byroot committed Mar 26, 2023
1 parent e4f5299 commit a1e9c17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ To connect using Sentinel, use:
SENTINELS = [{ host: "127.0.0.1", port: 26380 },
{ host: "127.0.0.1", port: 26381 }]

redis = Redis.new(url: "redis://mymaster", sentinels: SENTINELS, role: :master)
redis = Redis.new(name: "mymaster", sentinels: SENTINELS, role: :master)
```

* The master name identifies a group of Redis instances composed of a master
Expand All @@ -129,6 +129,12 @@ SENTINELS = [{ host: '127.0.0.1', port: 26380, password: 'mysecret' },
redis = Redis.new(name: 'mymaster', sentinels: SENTINELS, role: :master)
```

Also the name can be passed as an url:

```ruby
redis = Redis.new(name: "redis://mymaster", sentinels: SENTINELS, role: :master)
```

## Cluster support

[Clustering](https://redis.io/topics/cluster-spec). is supported via the [`redis-clustering` gem](cluster/).
Expand Down

0 comments on commit a1e9c17

Please sign in to comment.