diff --git a/dbm-services/mysql/db-simulation/app/service/kubernets.go b/dbm-services/mysql/db-simulation/app/service/kubernets.go index 69c7552cb6..b4cbf974a2 100644 --- a/dbm-services/mysql/db-simulation/app/service/kubernets.go +++ b/dbm-services/mysql/db-simulation/app/service/kubernets.go @@ -119,6 +119,8 @@ func (k *DbPodSets) getCreateClusterSqls() []string { return ss } +// getClusterPodContanierSpec create cluster pod container spec +// nolint func (k *DbPodSets) getClusterPodContanierSpec() []v1.Container { return []v1.Container{ { @@ -135,6 +137,8 @@ func (k *DbPodSets) getClusterPodContanierSpec() []v1.Container { "--log_bin_trust_function_creators", "--port=20000", "--max_allowed_packet=1073741824", + "--default-authentication-plugin=mysql_native_password", + "--sql-mode=", fmt.Sprintf("--character-set-server=%s", k.BaseInfo.Charset), "--user=mysql"}, @@ -351,7 +355,11 @@ func (k *DbPodSets) gettdbctlResourceLimit() v1.ResourceRequirements { // CreateMySQLPod create mysql pod func (k *DbPodSets) CreateMySQLPod() (err error) { - startArgs := []string{"--defaults-file=/etc/my.cnf", "--skip-log-bin", "--max_allowed_packet=1073741824", + startArgs := []string{ + "--defaults-file=/etc/my.cnf", + "--skip-log-bin", + "--max_allowed_packet=1073741824", + "--default-authentication-plugin=mysql_native_password", fmt.Sprintf("--character-set-server=%s", k.BaseInfo.Charset)} startArgs = append(startArgs, k.BaseInfo.Args...) startArgs = append(startArgs, "--user=mysql") diff --git a/dbm-services/mysql/db-simulation/handler/handler.go b/dbm-services/mysql/db-simulation/handler/handler.go index 869952e08f..b237a2c8b5 100644 --- a/dbm-services/mysql/db-simulation/handler/handler.go +++ b/dbm-services/mysql/db-simulation/handler/handler.go @@ -36,9 +36,10 @@ type Response struct { // CreateClusterParam 创建临时的spider的集群参数 type CreateClusterParam struct { - Pwd string `json:"pwd"` - PodName string `json:"podname"` - SpiderVersion string `json:"spider_version"` + Pwd string `json:"pwd"` + PodName string `json:"podname"` + SpiderVersion string `json:"spider_version"` + BackendVersion string `json:"backend_version"` } // CreateTmpSpiderPodCluster 创建临时的spider的集群,多用于测试,debug @@ -55,7 +56,12 @@ func CreateTmpSpiderPodCluster(r *gin.Context) { RootPwd: param.Pwd, Charset: "utf8mb4", } - ps.DbImage = config.GAppConfig.Image.Tendb57Img + var err error + ps.DbImage, err = getImgFromMySQLVersion(param.BackendVersion) + if err != nil { + logger.Error(err.Error()) + return + } ps.SpiderImage, ps.TdbCtlImage = getSpiderAndTdbctlImg(param.SpiderVersion, LatestVersion) if err := ps.CreateClusterPod(); err != nil { logger.Error(err.Error())