From f672ace87225109a945e5be8bea864ed5136b2a6 Mon Sep 17 00:00:00 2001 From: ymakedaq <996156275@qq.com> Date: Fri, 12 Apr 2024 10:07:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(dbm-services):=20=E5=85=81=E8=AE=B8proxy,ba?= =?UTF-8?q?ckend=E7=AB=AF=E5=8F=A3=E4=B8=BA3306=20#3946?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pkg/components/mysql_proxy/set_backend.go | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql_proxy/set_backend.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql_proxy/set_backend.go index 17bf9bcba4..3ea9a86e71 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql_proxy/set_backend.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql_proxy/set_backend.go @@ -1,7 +1,14 @@ -// Package mysql_proxy TODO /* - * @Description: 设置proxy后端,建立proxyh和master的关系 + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. */ + +// Package mysql_proxy 设置proxy后端,建立proxyh和master的关系 package mysql_proxy import ( @@ -14,22 +21,22 @@ import ( "dbm-services/mysql/db-tools/dbactuator/pkg/native" ) -// ProxySetBackendCom TODO +// ProxySetBackendCom proxy set backend mysql comp type ProxySetBackendCom struct { GeneralParam *components.GeneralParam Params ProxySetBackendParam proxyAdminConn *native.ProxyAdminDbWork `json:"-"` } -// ProxySetBackendParam TODO +// ProxySetBackendParam proxy set backend mysql param type ProxySetBackendParam struct { - Host string `json:"host" validate:"required,ip" ` // 当前实例的主机地址 - Port int `json:"port" validate:"required,gt=3306"` // 当前实例的端口 + Host string `json:"host" validate:"required,ip" ` // 当前实例的主机地址 + Port int `json:"port" validate:"required,gte=3306"` // 当前实例的端口 BackendHost string `json:"backend_host" validate:"required,ip"` - BackendPort int `json:"backend_port" validate:"required,gt=3306"` + BackendPort int `json:"backend_port" validate:"required,gte=3306"` } -// Example TODO +// Example proxy set backend mysql example func (p *ProxySetBackendCom) Example() interface{} { comp := ProxySetBackendCom{ Params: ProxySetBackendParam{ @@ -42,7 +49,7 @@ func (p *ProxySetBackendCom) Example() interface{} { return comp } -// Init TODO +// Init init proxy set backend mysql /** * @description: 建立proxy amdin conn, 并且检查 backends 是否为 1.1.1.1:3306(新上架的proxy backends 一定是1.1.1.1:3306) * @return {*} @@ -70,7 +77,7 @@ func (p *ProxySetBackendCom) Init() (err error) { return } -// SetBackend TODO +// SetBackend set backend /** * @description: refresh backends * @return {*}