[root@ucenter01 ~]# kubectl get svc -n service-software | grep mha
mha-mysql ClusterIP 10.96.111.34 <none> 3306/TCP,3307/TCP 91d
mha-mysql-deploy ClusterIP 10.96.89.232 <none> 3306/TCP 3d14h
mhanta-mysql ClusterIP 10.96.138.248 <none> 3306/TCP,3307/TCP 2d23h
mhanta-mysql-deploy ClusterIP 10.96.244.53 <none> 3306/TCP 2d23h
[root@ucenter01 ~]# mysql -h 10.96.89.232 -u root -P 3306 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1019823
Server version: 5.7.29-32-57-log Percona XtraDB Cluster (GPL), Release rel31.43, Revision 56bce88, WSREP version 31.43, wsrep_31.43
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
这么连试试
不对 报错为ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
这报错不是密码不对的意思吧?
[root@ucenter01 ~]# kubectl get svc -n service-software | grep mha mha-mysql ClusterIP 10.96.111.34 <none> 3306/TCP,3307/TCP 91d mha-mysql-deploy ClusterIP 10.96.89.232 <none> 3306/TCP 3d14h mhanta-mysql ClusterIP 10.96.138.248 <none> 3306/TCP,3307/TCP 2d23h mhanta-mysql-deploy ClusterIP 10.96.244.53 <none> 3306/TCP 2d23h [root@ucenter01 ~]# mysql -h 10.96.89.232 -u root -P 3306 -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 1019823 Server version: 5.7.29-32-57-log Percona XtraDB Cluster (GPL), Release rel31.43, Revision 56bce88, WSREP version 31.43, wsrep_31.43 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]> 这么连试试
上面这条kubectl是干嘛的