You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now use `sentinelClient` as a regular client: `set`, `get`, `hmset`, etc.
28
31
29
-
## Options
32
+
### RedisSentinelClient Options
33
+
30
34
-`masterName`: Which master the sentinel is listening to. Defaults to 'mymaster'. (If a sentinel is listening to multiple masters, create multiple `RedisSentinelClients`.)
31
35
-`logger`: pass in [winston](https://github.com/flatiron/winston) or another custom logger, otherwises uses console. (Expects a `log` method.)
32
36
-`debug`: verbose output (to `logger` about internal ops)
33
37
34
38
35
-
## RedisSentinelClient Methods
39
+
###RedisSentinelClient Methods
36
40
37
41
-`getMaster()`: returns a reference to the sentinel client's `activeMasterClient` (also available directly)
38
42
-`reconnect()`: used on instantiation and on psub events, this checks if the master has changed and connects to the new master.
39
43
-`send_command()` (and any other `RedisClient` command): command is passed to the master client.
40
44
41
45
42
-
## RedisSentinelClient Events
46
+
###RedisSentinelClient Events
43
47
44
48
-`sentinel message` (`msg`): passed up from the sentinel's channel listener. Note, messages can be about other masters, does not differentiate.
45
49
-`failover-start`: corresponds to sentinel's `+failover-triggered` message.
@@ -50,7 +54,7 @@ Now use `sentinelClient` as a regular client: `set`, `get`, `hmset`, etc.
50
54
-`error` (`error`): An error occured. (Currently does not differentiate errors in different components.) Will fire errors during a failover, before new master is connected.
51
55
52
56
53
-
# Limitations
57
+
### RedisSentinelClient Limitations
54
58
55
59
- Unlike `RedisClient`, `RedisSentinelClient` is not / does not need to be a stream
56
60
- Sentinel docs don't specify a default host+port, so option-less implementations of `createClient()` won't be compatible
@@ -59,8 +63,12 @@ Now use `sentinelClient` as a regular client: `set`, `get`, `hmset`, etc.
59
63
- With non-atomic operations like pub/sub, your code needs to listen to `reconnect` events and reload its client.
60
64
61
65
62
-
# Possible roadmap
66
+
###Possible roadmap
63
67
64
68
- Multiple master/slave(s) clusters per sentinel
65
69
- But thinking not: Just create multiple sentinel clients, one per cluster.
0 commit comments