Switchover
Scenario Overview
Once Geo H/A has been enabled, and the settings updated in Crosscluster, the user may want to manually perform a switchover to address issues which have popped up on the cluster but have not yet resulted in an automated switchover from the Arbiter. In such cases the client provides the modified payload in the below listed JSON file to properly update the leadership states across AZ's. The complete request could fail or succeed, and if it succeeds the user must view the job and it's associated events to see if it fails or succeeds.
Prerequisites
Before running this example, ensure to obtain access token. Refer 'Getting Started' section.
Switchover
Run the script switchover from the example directory.
cd cnc-crosscluster-api-examples;./switchover.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
switchover() {
# assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
# read from jwt file and export it as AUTH_TOKEN_HDR
export_jwt
# STEP 1 : User to update input json with details of job to be created in the file CNC_API_INPUT
# STEP 2 : trigger switchover API
# STEP 3 : store the output in CNC_API_OUTPUT file
CNC_CROSSCLUSTER_API=$CNC_CROSSCLUSTER_API_CTX/switchover
CNC_API_INPUT="@$PRJ/input/switchover.json"
CNC_API_OUTPUT="$PRJ/output/switchover.json"
http_post $CNC_CROSSCLUSTER_API $CNC_API_INPUT $CNC_API_OUTPUT
}
switchover