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
Copy file name to clipboardExpand all lines: content/develop/clients/jedis/failover.md
+122-6Lines changed: 122 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,10 @@ diagram below shows this process:
36
36
37
37
{{< image filename="images/failover/failover-client-reconnect.svg" alt="Failover and client reconnection" >}}
38
38
39
-
The complementary technique of *failback* then involves checking the original
40
-
endpoint periodically to see if it has recovered, and switching back to it
41
-
when it is available again:
39
+
The complementary technique of *failback* then involves periodically checking the health
40
+
of endpoints that are preferred to the current, temporary endpoint.
41
+
If any preferred endpoint has recovered, the connection is switched over to it.
42
+
This could potentially continue until the best endpoint is available again.
42
43
43
44
{{< image filename="images/failover/failover-client-failback.svg" alt="Failback: client switches back to original server" width="75%" >}}
44
45
@@ -86,7 +87,7 @@ server during periods of inactivity. This can help to detect when the
86
87
server has failed and a failover is needed even when your app is not actively
87
88
using it.
88
89
89
-
## Configure Jedis for failover
90
+
## Failover configuration
90
91
91
92
The example below shows a simple case with a list of two servers,
92
93
`redis-east` and `redis-west`, where `redis-east` is the preferred
@@ -194,7 +195,122 @@ The `MultiClusterClientConfig` builder has the following options to configure re
194
195
|`retryIncludedExceptionList()`| See description |`List` of `Throwable` classes that should be considered as failures to be retried. By default, it includes just `JedisConnectionException`. |
195
196
|`retryIgnoreExceptionList()`|`null`|`List` of `Throwable` classes that should be ignored for retry. |
196
197
197
-
###Health check configuration
198
+
## Health check configuration
198
199
199
200
The general strategy for health checks is to ask the Redis server for a
200
-
response that it could only give if it is healthy.
201
+
response that it could only give if it is healthy. There are several
202
+
specific strategies available for health checks that you can configure using the
203
+
`MultiClusterClientConfig` builder. The sections below explain these
204
+
in more detail.
205
+
206
+
### `EchoStrategy` (default)
207
+
208
+
The default strategy, `EchoStrategy`, periodically sends a Redis
209
+
[`ECHO`]({{< relref "/commands/echo" >}}) command
210
+
and checks that it gives the expected response. Any unexpected response
211
+
or exception indicates an unhealthy server. Although `EchoStrategy` is
212
+
very simple, it is a good basic approach for most Redis deployments.
213
+
214
+
### `LagAwareStrategy` (preview)
215
+
216
+
`LagAwareStrategy` (currently in preview) is designed specifically for
0 commit comments