2

I would like to create a replica of a database hosted on a VM on my computer (MASTER) to the AWS cloud (SLAVE).

I can connect on the 2 DB from a EC2 instance.

I set the parameters with the AWS script:

mysql> CALL mysql.rds_set_external_master ('<MY.PUBLIC.IP>', 3306, '<username>', '<password>', 'mysqld-bin.0000013', 343, 0);

(Of course my IP, username, and password are hidden here)

But when a start the replication (with the AWS script) it keep beeing stuck with:

mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: <MY-PUBLIC-IP> (censored here)
                  Master_User: slaveuser
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysqld-bin.0000013
          Read_Master_Log_Pos: 343
               Relay_Log_File: relaylog.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysqld-bin.0000013
             Slave_IO_Running: Connecting
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 

I added my public IP in the RDS's security group with the MYSQL port (didn't change it, still 3306) But nothing, no error in particular (Last_errno: 0 etc...)

What did I missed?

jerome
  • 21
  • 2

2 Answers2

0
  1. Is your master DB VM behind a NAT? And if so have you got the MySQL port forwarded from outside to the VM?

  2. Is your RDS in a subnet from which it has access outside? I.e. either in a public subnet with IGW attached and a Public IP, or in a private subnet with NAT Gateway?

Both these conditions must be true if you want to connect from RDS to your VM.

Hope that helps :)

MLu
  • 24,849
  • 5
  • 59
  • 86
0

Thanks for your answer :)

  1. It is behind a NAT but the 3306 is forwarded to it. It is accessible by the WAN, I'm connected from the EC2 instance

  2. You may be right, it gives me the idea to try to connect to the RDS DB from the VM and... i can't (connection timed out) I don't understand why tho, The RDS is public The RDS is in a security group accepting my public IP for the MYSQL traffic

Found it, i modified my route tables and it's all right!

Thanks for getting me on the right way

jerome
  • 21
  • 2