File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const (
3232
3333 mysqldExporterContainerName = "mysqld-exporter"
3434 mysqldExporterCommand = "/bin/mysqld_exporter"
35+ mysqldExporterMySQLCnf = "client.cnf"
3536 mysqldExporterUser = "vt_dba"
3637 mysqldExporterPort = 9104
3738 mysqldExporterPortName = "metrics"
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ ln -sf /dev/stderr /mnt/vt/config/stderr.symlink
4040echo "log-error = /vt/config/stderr.symlink" > /mnt/vt/config/mycnf/log-error.cnf
4141echo "binlog_format=row" > /mnt/vt/config/mycnf/rbr.cnf
4242echo "socket = ` + mysqlSocketPath + `" > /mnt/vt/config/mycnf/socket.cnf
43+ echo -n "[client]\nuser=` + mysqldExporterUser + `\nsocket=` + mysqlSocketPath + `\n" > /mnt/vt/config/mycnf/` + mysqldExporterMySQLCnf + `
4344`
4445
4546 mysqlSocketInitScript = `set -ex
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717package vttablet
1818
1919import (
20+ "path/filepath"
2021 "strconv"
2122 "strings"
2223
@@ -210,6 +211,9 @@ func UpdatePod(obj *corev1.Pod, spec *Spec) {
210211 key = strings .TrimLeft (key , "-" )
211212 mysqldExporterAllFlags [key ] = value
212213 }
214+ if _ , ok := mysqldExporterAllFlags ["config.my-cnf" ]; ! ok {
215+ mysqldExporterAllFlags ["config.my-cnf" ] = filepath .Join (vtMycnfPath , mysqldExporterMySQLCnf )
216+ }
213217 }
214218
215219 // TODO: Can/should we still run mysqld_exporter pointing at external mysql?
You can’t perform that action at this time.
0 commit comments