From 698bd0137ac62a4355e9410bd492f6ccaa5ae06c Mon Sep 17 00:00:00 2001 From: kubejocker Date: Wed, 22 Jan 2025 18:11:37 +0800 Subject: [PATCH] chore: support mysql orc semi sync --- addons/mysql/templates/switchover.yaml | 6 +++++- addons/orchestrator/configs/orchestrator.tpl | 2 +- examples/mysql/switchover-orc.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/mysql/templates/switchover.yaml b/addons/mysql/templates/switchover.yaml index a25da9fa0..b7eefa457 100644 --- a/addons/mysql/templates/switchover.yaml +++ b/addons/mysql/templates/switchover.yaml @@ -37,4 +37,8 @@ spec: - /bin/sh - -c - | - curl -s http://${ORC_ENDPOINTS}/api/graceful-master-takeover-auto/${candidate} \ No newline at end of file + response=$(curl -s -o /dev/null -w "%{http_code}" http://${ORC_ENDPOINTS}/api/graceful-master-takeover-auto/${candidate}) + if [ ! $response -eq 200 ]; then + echo "switchover failed, please check the candidate format: {podName}.{namespace}" + exit 1 + fi diff --git a/addons/orchestrator/configs/orchestrator.tpl b/addons/orchestrator/configs/orchestrator.tpl index 15e883d02..2c896e0bf 100644 --- a/addons/orchestrator/configs/orchestrator.tpl +++ b/addons/orchestrator/configs/orchestrator.tpl @@ -10,7 +10,7 @@ "MySQLTopologySSLCertFile": "", "MySQLTopologySSLCAFile": "", "MySQLTopologySSLSkipVerify": true, - "MySQLTopologyUseMutualTLS": true, + "MySQLTopologyUseMutualTLS": false, "MySQLOrchestratorHost": "${META_MYSQL_ENDPOINT}", "MySQLOrchestratorPort": ${META_MYSQL_PORT}, diff --git a/examples/mysql/switchover-orc.yaml b/examples/mysql/switchover-orc.yaml index baa88ada3..588907a8a 100644 --- a/examples/mysql/switchover-orc.yaml +++ b/examples/mysql/switchover-orc.yaml @@ -12,5 +12,5 @@ spec: - componentName: mysql parameters: - name: candidate - value: mysql-cluster-mysql-1 + value: mysql-cluster-mysql-1.default opsDefinitionName: mysql-orc-switchover # predefined opsdefinition for switchover \ No newline at end of file