我目前正面临着尝试使用redhat os在amazon EC2上创建mysql主/从服务器的问题。在大多数情况下,我都遵循了本教程(http://www.howtoforge.com/how-to-set-up-mysql-database-replication-on-fedora-10)。
调用SHOW SLAVE STATUS \ G时;我明白了:
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: XXX.XXX.XXX.XXX
Master_User: slave_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 337
Relay_Log_File: mysqld-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: testdb
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 1
Exec_Master_Log_Pos: 337
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 2013
Last_IO_Error: error connecting to master 'slave_user@XXX.XXX.XXX.XXX:3306' - retry-time: 60 retries: 86400
Last_SQL_Errno: 0
Last_SQL_Error:
我的奴隶my.cnf
[mysqld]
server-id=2
master-host=XXX.XXX.XXX.XXX
master-user=slave_user
master-password=slave_password
master-connect-retry=60
replicate-do-db=mosaicschroma
skip-name-resolve
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
和我的主人my.cnf
[mysqld]
log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=mosaicschroma
server-id=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
当使用nmap检查我是否可以ping其他服务器和端口3306时,我收到过滤的报告,我认为是正确的。
非常感谢任何帮助,谢谢!
答案 0 :(得分:0)
我会先从奴隶机上尝试:
telnet master-machine 3306
如果你收到像这样的乱码mysql消息,那么你没有防火墙连接问题:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
N
5.5.34-log>W~4%]$�>eb;>gi\rGK#mysql_native_password
同样如grossvogel
所述,请检查您尝试用来连接主服务器的从属用户的授权。