Hi All,
My netdata container collects MySQL stats as expected from the MariaDB database on the host, as long as netdata is started while MariaDB is running. The problem is when the database is restarted, netadata MySQL data collection stops. The logs show ‘connection refused’ when using MySQL collector in debug mode.
[ ERROR ] mysql[local] mysql.go:93 error on pinging the mysql database [netdata:net01@@unix(/var/lib/mysql/mysql.sock)/]: dial unix /var/lib/mysql/mysql.sock: connect: connection refused
Thanks.
Environment
netdata v1.31.0
Red Hat Enterprise Linux release 8.4 (Ootpa)
MariaDb v10.4.21
What I expected to happen
I expect the data collection to recommence and the MySQL graphs to render as per normal.
[ DEBUG ] mysql[local] mysql.go:97 connected using DSN [netdata:net01@@unix(/var/lib/mysql/mysql.sock)/]
Yes the above is correct. Here are the last few lines of output from debug mode;
BEGIN ‘mysql_local.userstats_commands_maxscale’ 999832
SET ‘userstats_maxscale_select_commands’ = 1320
SET ‘userstats_maxscale_update_commands’ = 0
SET ‘userstats_maxscale_other_commands’ = 3
END
BEGIN ‘netdata.execution_time_of_mysql_local’ 999832
SET ‘time’ = 3
END
[ DEBUG ] run[manager] run.go:41 tick 4
[ DEBUG ] mysql[local] collect_global_status.go:144 executing query: ‘SHOW GLOBAL STATUS’
[mysql] 2021/10/15 02:30:03 packets.go:122: closing bad idle connection: EOF
[ INFO ] main[main] agent.go:191 received broken pipe signal (13). Terminating…
bash-5.0$
BEGIN ‘mysql_local.userstats_commands_root’ 1000166
SET ‘userstats_root_select_commands’ = 962
SET ‘userstats_root_update_commands’ = 4
SET ‘userstats_root_other_commands’ = 962
END
BEGIN ‘netdata.execution_time_of_mysql_local’ 1000166
SET ‘time’ = 5
END
[ DEBUG ] run[manager] run.go:41 tick 41
[ DEBUG ] mysql[local] collect_global_status.go:144 executing query: ‘SHOW GLOBAL STATUS’
[mysql] 2021/10/22 09:23:39 packets.go:123: closing bad idle connection: EOF
[ ERROR ] mysql[local] mysql.go:105 error on collecting global status: dial tcp 10.195.225.51:3306: connect: connection refused
[ DEBUG ] run[manager] run.go:41 tick 42
[ DEBUG ] mysql[local] collect_global_status.go:144 executing query: ‘SHOW GLOBAL STATUS’
[ ERROR ] mysql[local] mysql.go:105 error on collecting global status: dial tcp 10.195.225.51:3306: connect: connection refused
[ DEBUG ] run[manager] run.go:41 tick 43
[ DEBUG ] mysql[local] collect_global_status.go:144 executing query: ‘SHOW GLOBAL STATUS’
[ DEBUG ] run[manager] run.go:41 tick 44
[ DEBUG ] mysql[local] job.go:174 skip the tick due to previous run hasn’t been finished
[mysql] 2021/10/22 09:23:42 packets.go:37: read tcp 10.0.2.100:32920->10.195.225.51:3306: read: connection reset by peer
[ INFO ] main[main] agent.go:191 received broken pipe signal (13). Terminating…
bash-5.0$