环境说明:
系统:CentOS Linux release 7.8.2003 (Core)
mysql:mysql Ver 8.0.24 for Linux on x86_64 (MySQL Community Server – GPL)(二进制安装)
共4个主机,GTID主从复制搭建完成,MHA安装在172.16.30.203主机上并已经启动(功用有VIP漂移和bingserver)
主库:172.16.30.202(主机名db02)
从库:172.16.30.201(主机名db01)
从库:172.16.30.203(主机名db03)
atlias安装在172.16.30.204(主机名db04)主机上,配置文件如下:
(安装的atlias版本:Atlas-2.2.1.el6.x86_64.rpm)
[root@db04 bin]# cat /usr/local/mysql-proxy/conf/test.cnf
[mysql-proxy]
admin-username = user
admin-password = pwd
proxy-backend-addresses = 172.16.30.250:3306 #172.16.30.250是MHA虚拟的VIP地址;
proxy-read-only-backend-addresses = 172.16.30.201:3306,172.16.30.203:3306
pwds = repl:XA0rLg9XoGE=, mha:XA0rLg9XoGE=
daemon = true
keepalive = true
event-threads = 8
log-level = message
log-path = /usr/local/mysql-proxy/log
sql-log = ON
proxy-address = 0.0.0.0:1234
admin-address = 0.0.0.0:2345
charset = utf8
启动alias
[root@db04 bin]# /usr/local/mysql-proxy/bin/mysql-proxyd test start
OK: MySQL-Proxy of test is started
[root@db04 bin]# netstat -ltnup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1234 0.0.0.0:* LISTEN 25635/mysql-proxy
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 960/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1267/master
tcp 0 0 0.0.0.0:2345 0.0.0.0:* LISTEN 25635/mysql-proxy
tcp6 0 0 :::22 :::* LISTEN 960/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1267/master
[root@db04 tools]# ps -ef |grep mysql-proxy
root 25634 1 0 11:13 ? 00:00:00 /usr/local/mysql-proxy/bin/mysql-proxy –defaults-file=/usr/local/mysql-proxy/conf/test.cnf
root 25635 25634 0 11:13 ? 00:00:00 /usr/local/mysql-proxy/bin/mysql-proxy –defaults-file=/usr/local/mysql-proxy/conf/test.cnf
root 25935 13424 0 11:19 pts/2 00:00:00 grep –color=auto mysql-proxy
问题:无法登录altias,提示如下错误:db04这台主机没有启动mysql。
[root@db04 tools]# mysql -umha -p1122 -h 172.16.30.204 -P 1234
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user ‘mha’@’172.16.30.204:60402’ (using password: YES)
[root@db04 tools]# mysql -uuser -ppwd -h 172.16.30.204 -P 2345
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): password doesn’t match
不太清楚是什么问题,请各位帮小弟看看。先谢谢大家。
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/148600.html