Example: Using ALT to Promote a Read Replica to Primary
This section describes how to use ALT to promote a read replica to primary. The process for minor version upgrades and specification changes is similar.
The process for using ALT to promote a read replica to primary is as follows:
Step 1: Buy a GaussDB(for MySQL) Instance
Step 2: Create a Proxy Instance
Step 4: Connect Your Application to the Proxy Instance
Step 5: Promote a Read Replica to Primary
Constraints
If workloads are interrupted, see Precautions.
Step 4: Connect Your Application to the Proxy Instance
For details, see Step 4: Use the Proxy Address to Connect to Your GaussDB(for MySQL) Instance.
Step 6: Test the ALT Effect
If ALT is enabled and you promote a read replica to primary using sysbench, tpcc-mysql, or a MySQL client that is connected to the proxy address, your database only freezes briefly.
The following figures show you what effect ALT has when you promote a read replica to primary using sysbench, tpcc-mysql, and a MySQL client.
- Promoting a read replica to primary using sysbench
- Promoting a read replica to primary using tpcc-mysql
- Promoting a read replica to primary using the MySQL CLI
As shown in the following figure, user-defined variables, session variables, and databases remain unchanged before and after you promote a read replica to primary.
The following figure shows how the transaction draining timeout interval determines whether ALT is available for the current session.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot