On the separation of reading and writing in Atlias

lhbgood 2021-09-15 09:55:11

Environmental statement :
System :CentOS Linux release 7.8.2003 (Core)
mysql:mysql  Ver 8.0.24 for Linux on x86_64 (MySQL Community Server - GPL)( Binary installation )
common 4 Host computer ,GTID The master-slave replication is completed ,MHA Installed in the 172.16.30.203 On the host and has started ( The functions are VIP Drift and bingserver)
Main library :172.16.30.202( Host name db02)
Slave Library :172.16.30.201( Host name db01)
Slave Library :172.16.30.203( Host name db03)
atlias Installed in the 172.16.30.204( Host name db04) On a host , The configuration file is as follows :
( Installed atlias edition :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 yes MHA Virtual VIP Address ;
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

start-up 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


problem : Unable to login altias, Note the following error :db04 This host is not started 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

I'm not sure what the problem is , Please help me see . Thank you first .

 

Please bring the original link to reprint ,thank
Similar articles

2021-09-15

2021-09-15