Question

I am currently facing an issue with trying to create a mysql master/slave server on amazon EC2 using redhat os. For the most part I have followed this tutorial (http://www.howtoforge.com/how-to-set-up-mysql-database-replication-on-fedora-10).

When calling SHOW SLAVE STATUS\G; I get:

*************************** 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 Slave 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

and my master 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

when using nmap to check if I can ping the other server and port 3306 I receive a report of filtered which I assume is correct.

Any help is greatly appreciated, Thanks!

Was it helpful?

Solution

I would try first from the slave machine:

telnet master-machine 3306

If you get a garbled mysql message like this then you have no firewall connection issues:

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

Also like grossvogel said, check the grants for the slave user that you are trying to use to connect to the master.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top