From 7a24589f77fd6342d08d409dc47657bcb7a82514 Mon Sep 17 00:00:00 2001 From: acekingke Date: Mon, 29 Nov 2021 14:41:47 +0800 Subject: [PATCH] mysqlcluster: sysbench press the database, Pod is recreated by k8s #305 --- mysqlcluster/container/mysql.go | 6 +----- mysqlcluster/container/mysql_test.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mysqlcluster/container/mysql.go b/mysqlcluster/container/mysql.go index 92c90377..ef02ba16 100644 --- a/mysqlcluster/container/mysql.go +++ b/mysqlcluster/container/mysql.go @@ -88,11 +88,7 @@ func (c *mysql) getLivenessProbe() *corev1.Probe { return &corev1.Probe{ Handler: corev1.Handler{ Exec: &corev1.ExecAction{ - Command: []string{ - "sh", - "-c", - fmt.Sprintf("mysqladmin --defaults-file=%s ping", utils.ConfClientPath), - }, + Command: []string{"pgrep", "mysqld"}, }, }, InitialDelaySeconds: 30, diff --git a/mysqlcluster/container/mysql_test.go b/mysqlcluster/container/mysql_test.go index a9216530..9ac16a3a 100644 --- a/mysqlcluster/container/mysql_test.go +++ b/mysqlcluster/container/mysql_test.go @@ -107,7 +107,7 @@ func TestGetMysqlLivenessProbe(t *testing.T) { livenessProbe := &corev1.Probe{ Handler: corev1.Handler{ Exec: &corev1.ExecAction{ - Command: []string{"sh", "-c", "mysqladmin --defaults-file=/etc/mysql/client.conf ping"}, + Command: []string{"pgrep", "mysqld"}, }, }, InitialDelaySeconds: 30,