I am working on an Ubuntu 16.04 VirtualBox instance on a Mac machine. I am working in MySQL version 5.7.16. I am trying to set up Master-Master replication between another Ubuntu 16.04 VirtualBox instance and mine. Currently, the machines are refusing to talk to each other:
| Connecting to master | paul-VirtualBox | slaveuser1 | 3306 | 60 | mysql-bin.000002 | 332 | tim-VirtualBox-relay-bin.000002 | 4 | mysql-bin.000002 | Connecting | Yes | | | | | | | 0 | | 0 | 332 | 154 | None | | 0 | No | | | | | | NULL | No | 2005 | error connecting to master 'slaveuser1@paul-VirtualBox:3306' - retry-time: 60 retries: 46 | 0 | | | 0 | | /var/lib/mysql/master.info | 0 | NULL | Slave has read all relay log; waiting for more updates | 86400 | | 161206 15:50:14 | | | | | | 0 |
We have both given the listed users permissions to be replication users, and have specified them with the hostnames of our virtual machines, which are listed in our hostnames file. We have set our bind-addresses to 0.0.0.0. Other users can connect to the database on the other machine, we just can't get our master-master connection to work. In the /etc/hosts file, my hostname, tim-VirtualBox has the IP of 127.0.1.1. I am wondering, with the Virtual Machine IP listed as 127.0.1.1, should I create the replication users with the IP of 0.0.0.0, or must I hard code a master-ip, while keeping the binding-address of 0.0.0.0? If so, I do not have a static IP, for I am on a wireless network elsewhere, so the IP always changes. Would I use the IP given to me at each instance?
To clarify:
master list has been populated on both machines
replication users have been created for both machines on root
both servers have unique ids
both servers are virtual machines
neither server has a static ip
port forwarding for 3306 is enabled
binding-addresses are 0.0.0.0