Failover when clusterA is down

Failover when clusterA is down

  1. Promote the follower indices in clusterB into regular indices so that they accept writes. This can be achieved by:

    • First, pause indexing following for the follower index.
    • Next, close the follower index.
    • Unfollow the leader index.
    • Finally, open the follower index (which at this point is a regular index).
    1. resp = client.ccr.pause_follow(
    2. index="kibana_sample_data_ecommerce2",
    3. )
    4. print(resp)
    5. resp1 = client.indices.close(
    6. index="kibana_sample_data_ecommerce2",
    7. )
    8. print(resp1)
    9. resp2 = client.ccr.unfollow(
    10. index="kibana_sample_data_ecommerce2",
    11. )
    12. print(resp2)
    13. resp3 = client.indices.open(
    14. index="kibana_sample_data_ecommerce2",
    15. )
    16. print(resp3)
    1. response = client.ccr.pause_follow(
    2. index: 'kibana_sample_data_ecommerce2'
    3. )
    4. puts response
    5. response = client.indices.close(
    6. index: 'kibana_sample_data_ecommerce2'
    7. )
    8. puts response
    9. response = client.ccr.unfollow(
    10. index: 'kibana_sample_data_ecommerce2'
    11. )
    12. puts response
    13. response = client.indices.open(
    14. index: 'kibana_sample_data_ecommerce2'
    15. )
    16. puts response
    1. const response = await client.ccr.pauseFollow({
    2. index: "kibana_sample_data_ecommerce2",
    3. });
    4. console.log(response);
    5. const response1 = await client.indices.close({
    6. index: "kibana_sample_data_ecommerce2",
    7. });
    8. console.log(response1);
    9. const response2 = await client.ccr.unfollow({
    10. index: "kibana_sample_data_ecommerce2",
    11. });
    12. console.log(response2);
    13. const response3 = await client.indices.open({
    14. index: "kibana_sample_data_ecommerce2",
    15. });
    16. console.log(response3);
    1. ### On clusterB ###
    2. POST /kibana_sample_data_ecommerce2/_ccr/pause_follow
    3. POST /kibana_sample_data_ecommerce2/_close
    4. POST /kibana_sample_data_ecommerce2/_ccr/unfollow
    5. POST /kibana_sample_data_ecommerce2/_open
  2. On the client side (Logstash, Beats, Elastic Agent), manually re-enable ingestion of kibana_sample_data_ecommerce2 and redirect traffic to the clusterB. You should also redirect all search traffic to the clusterB cluster during this time. You can simulate this by ingesting documents into this index. You should notice this index is now writable.

    1. resp = client.index(
    2. index="kibana_sample_data_ecommerce2",
    3. document={
    4. "user": "kimchy"
    5. },
    6. )
    7. print(resp)
    1. response = client.index(
    2. index: 'kibana_sample_data_ecommerce2',
    3. body: {
    4. user: 'kimchy'
    5. }
    6. )
    7. puts response
    1. const response = await client.index({
    2. index: "kibana_sample_data_ecommerce2",
    3. document: {
    4. user: "kimchy",
    5. },
    6. });
    7. console.log(response);
    1. ### On clusterB ###
    2. POST kibana_sample_data_ecommerce2/_doc/
    3. {
    4. "user": "kimchy"
    5. }