Keycloak
94 строки · 2.8 Кб
1<#import "/templates/guide.adoc" as tmpl>
2<#import "/templates/links.adoc" as links>
3
4<@tmpl.guide
5title="Switch over to the secondary site"
6summary="This topic describes the operational procedures necessary" >
7
8This procedure switches from the primary site to the secondary site when using a setup as outlined in <@links.ha id="concepts-active-passive-sync" /> together with the blueprints outlined in <@links.ha id="bblocks-active-passive-sync" />.
9
10include::partials/infinispan/infinispan-attributes.adoc[]
11
12== When to use this procedure
13
14Use this procedure to gracefully take the primary offline.
15
16Once the primary site is back online, use the {sections} <@links.ha id="operate-network-partition-recovery" /> and <@links.ha id="operate-switch-back" /> to return to the original state with the primary site being active.
17
18See the <@links.ha id="introduction" /> {section} for different operational procedures.
19
20== Procedures
21
22=== {jdgserver_name} Cluster
23
24For the context of this {section}, `{site-a}` is the primary site and `{site-b}` is the secondary site.
25
26When you are ready to take a site offline, a good practice is to disable the replication towards it.
27This action prevents errors or delays when the channels are disconnected between the primary and the secondary site.
28
29==== Procedures to transfer state from secondary to primary site
30
31. Log in into your secondary site
32
33<#include "partials/infinispan/infinispan-cli-connect.adoc" />
34
35. Disable the replication to the primary site by running the following command:
36+
37.Command:
38[source,bash,subs="+attributes"]
39----
40site take-offline --all-caches --site={site-a-cr}
41----
42+
43.Output:
44[source,bash,subs="+attributes"]
45----
46{
47"offlineClientSessions" : "ok",
48"authenticationSessions" : "ok",
49"sessions" : "ok",
50"clientSessions" : "ok",
51"work" : "ok",
52"offlineSessions" : "ok",
53"loginFailures" : "ok",
54"actionTokens" : "ok"
55}
56----
57
58. Check the replication status is `offline`.
59+
60.Command:
61[source,bash,subs="+attributes"]
62----
63site status --all-caches --site={site-a-cr}
64----
65+
66.Output:
67[source,bash,subs="+attributes"]
68----
69{
70"status" : "offline"
71}
72----
73+
74If the status is not `offline`, repeat the previous step.
75
76The {jdgserver_name} cluster in the secondary site is ready to handle requests without trying to replicate to the primary site.
77
78=== AWS Aurora Database
79
80include::partials/aurora/aurora-failover.adoc[]
81
82=== {project_name} Cluster
83
84No action required.
85
86=== Route53
87
88To force Route53 to mark the primary site as not available, edit the health check in AWS to point to a non-existent route (`health/down`). After some minutes, the clients will notice the change and traffic will gradually move over to the secondary site.
89
90== Further reading
91
92See <@links.ha id="concepts-infinispan-cli-batch" /> on how to automate Infinispan CLI commands.
93
94</@tmpl.guide>
95