0

I am trying to setup replication across two servers on AWS. I am following the documentation and I am up to this point.

https://dev.mysql.com/doc/mysql-replication-excerpt/5.7/en/replication-howto-slaveinit.html

This is given.

mysql> CHANGE MASTER TO
->     MASTER_HOST='source_host_name',
->     MASTER_USER='replication_user_name',
->     MASTER_PASSWORD='replication_password',
->     MASTER_LOG_FILE='recorded_log_file_name',
->     MASTER_LOG_POS=recorded_log_position;

I am trying to be sure what to put as the source host name. Since the primary server is not on the same network as the replica server. What should be used as the host them.

Should it be the IP address:3306 or FQDN:3306. Should port 3306 be opened on the primary server.

user1794918
  • 103
  • 4

1 Answers1

0

In master host you can use either IP address. If a name is resolvable to the IP address, then the name can be used.

You don't need to specify a port number, the default port is used.

Port 3306 should be opened for connections from the secondary node. The port should not be opened for any connections due to security reasons.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58