Skip to content

Commit

Permalink
fix(redis): 密码特殊字符导致工具运行异常 TencentBlueKing#8954
Browse files Browse the repository at this point in the history
  • Loading branch information
xiepaup committed Jan 8, 2025
1 parent e808e3d commit 8c83f22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbm-services/redis/db-tools/dbmon/pkg/keylifecycle/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (t *Task) hotKeyWithMonitor(server Instance) (string, error) {
t.rotateFile(hkfile)

mylog.Logger.Info(fmt.Sprintf("do hot key analyse : %s", server.Addr))
hkCmd := fmt.Sprintf("%s hotkeys -A %s -S %s -a %s -D %s --raw -o %s > %s 2>&1",
hkCmd := fmt.Sprintf("%s hotkeys -A %s -S %s -a '%s' -D %s --raw -o %s > %s 2>&1",
consts.TendisKeyLifecycleBin, server.App, server.Addr, server.Password, server.Domain, t.logFile, hkfile)

mylog.Logger.Info(fmt.Sprintf("exec cmd : %s", hkCmd))
Expand Down Expand Up @@ -245,7 +245,7 @@ func (t *Task) bigKeyWithAof4Cache(server Instance, bkfile, kmfile string) (int6

step, slptime, sample, confidence, adjfactor := getStatToolParams(dbsize)
cmdExec := fmt.Sprintf(
"cat %s | %s keystat --stdin --raw -B %s -M %s -o %s -S %s -a %s -A %s -D %s "+
"cat %s | %s keystat --stdin --raw -B %s -M %s -o %s -S %s -a '%s' -A %s -D %s "+
"--step %d --keymodetop 100 --samples %d --confidence %d --adjfactor %d --duration %d > %s 2>&1",
allkeys, consts.TendisKeyLifecycleBin, bkfile, kmfile, t.logFile,
server.Addr, server.Password, server.App, server.Domain,
Expand Down Expand Up @@ -301,7 +301,7 @@ func (t *Task) statRawKeysFileDetail(keysFile string, bkFile string, kmFile stri
step, slptime, sample, confidence, adjfactor := getStatToolParams(keyLines)

cmdExec := fmt.Sprintf(
"cat %s | %s keystat --ssd --stdin --raw -B %s -M %s -o %s -S %s -a %s -A %s -D %s "+
"cat %s | %s keystat --ssd --stdin --raw -B %s -M %s -o %s -S %s -a '%s' -A %s -D %s "+
"--step %d --keymodetop 100 --samples %d --confidence %d --adjfactor %d --duration %d > %s 2>&1",
keysFile, consts.TendisKeyLifecycleBin, bkFile, kmFile, t.logFile,
server.Addr, server.Password, server.App, server.Domain,
Expand Down

0 comments on commit 8c83f22

Please sign in to comment.