Skip to content

Commit

Permalink
fix(redis): 修复创建dbareporter的bug TencentBlueKing#7335
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemakeit committed Oct 15, 2024
1 parent 0f69251 commit c61bde0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func (job *RedisVersionUpdate) allInstsAbleToConnect() (err error) {
if err != nil {
return err
}
cli.ConfigRewrite()
job.AddrMapCli[addr] = cli
}
job.runtime.Logger.Info("all redis instances able to connect,(%+v)", instsAddrs)
Expand Down Expand Up @@ -458,7 +459,7 @@ func (job *RedisVersionUpdate) stopRedis(port int) (err error) {
job.runtime.Logger.Info(fmt.Sprintf("su %s -c \"%s\"",
consts.MysqlAaccount, stopScript+" "+strconv.Itoa(port)+" xxxx"))
_, err = util.RunLocalCmd("su",
[]string{consts.MysqlAaccount, "-c", stopScript + " " + strconv.Itoa(port) + " " + password},
[]string{consts.MysqlAaccount, "-c", fmt.Sprintf("%s %d %q", stopScript, port, password)},
"", nil, 10*time.Minute)
if err != nil && !strings.Contains(err.Error(), "Warning: Using a password") {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CreateReportDir() (err error) {
rmCmd := "rm -rf " + consts.DbaReportSaveDir
util.RunBashCmd(rmCmd, "", nil, 1*time.Minute)
}
err = os.Symlink(realReportDir, filepath.Dir(consts.DbaReportSaveDir))
err = os.Symlink(realReportDir, consts.DbaReportSaveDir)
if err != nil {
err = fmt.Errorf("os.Symlink %s -> %s fail,err:%s", consts.DbaReportSaveDir, realReportDir, err)
mylog.Logger.Error(err.Error())
Expand Down

0 comments on commit c61bde0

Please sign in to comment.