pt-stalk get wrong mysqld pid when the host installed multi mysql instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Carlos Salguero |
Bug Description
host env:
Centos 6.8
percona-
two mysql instance:
$ pidof mysqld
33530 17881
my host have two mysql instance, 3304 port(pid: 17881) and 3306 port(pid: 33530), when I use pt-stalk to monitor 3304 port, the mysql info logs in /var/lib/pt-stalk/ is about 3306 port, this is wrong, I just want log the mysql 3304 port.
the following code in pt-stalk mabye get wrong mysql pid:
792 collect() {
793 local d="$1" # directory to save results in
794 local p="$2" # prefix for each result file
795
796 local mysqld_pid=$(_pidof mysqld | awk '{print $1; exit;}')
797
the subsequent mysql info will be wrong when mysqld_pid is wrong, pt-stalk should read mysql pid_file to get right pid number.
Changed in percona-toolkit: | |
assignee: | nobody → Carlos Salguero (carlos-salguero) |
milestone: | none → 2.2.21 |
With port=3307 option only it will not pick the right instance: pt-stalk/ *-variables pt-stalk/ 2016_11_ 25_04_49_ 31-variables: port 3306 pt-stalk/ 2016_11_ 25_04_50_ 01-variables: port 3306
[root@multi ~]# bash -x pt-stalk --no-stalk --iterations=2 --sleep=30 --user=root --password=p3rc0na --port=3307 > stalk.out 2>&1
[root@multi ~]# grep ^port /var/lib/
/var/lib/
/var/lib/
Using the socket will pick the right instance: /tmp/mysql1. sock > stalk1.out 2>&1 pt-stalk/ *-variables pt-stalk/ 2016_11_ 25_04_49_ 31-variables: port 3306 pt-stalk/ 2016_11_ 25_04_50_ 01-variables: port 3306 pt-stalk/ 2016_11_ 25_04_57_ 36-variables: port 3307 pt-stalk/ 2016_11_ 25_04_58_ 06-variables: port 3307
[root@multi ~]# bash -x pt-stalk --no-stalk --iterations=2 --sleep=30 --user=root --password=p3rc0na --socket=
[root@multi ~]# grep ^port /var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
attaching stalk.out file using the port=3307 option only