Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dbm-services): 模拟执行拉起8.0MySQL,修改默认认证插件 #8060 #8085

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dbm-services/mysql/db-simulation/app/service/kubernets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand All @@ -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"},
Expand Down Expand Up @@ -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")
Expand Down
14 changes: 10 additions & 4 deletions dbm-services/mysql/db-simulation/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
Expand Down
Loading