Struggling with MYSQL Master/Slave replication.
I followed the the DigitalOcean document for setting up the MYSQL Master/Slave replication. https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql#see-more
Both servers only allow SSH login and the SCP command to move copy the database dump required me to use my “admin” account and required me to enter my SSH passphrase.
the SQL.CNF has the require_secure_transport = on
The connection error I get from SHOW SLAVE STATUS\G is below
Last_IO_Errno: 3159 Last_IO_Error: error connecting to master ‘<replication_account_name>@<priv_ip_address>:3306’ - retry-time: 60 retries: 23
Do I need to create a SSH key for the <replication_account_name> account on both servers or is the fix something else? If so what?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Your current configuration is not using SSH for it’s connections as that is not covered by the guide you followed. This guide covers the changes needed to tunnel your master/slave connections over SSH.
Right now it appears that your configuration is attempting to connect directly to MySQL on port 3306 but MySQL does not listen on the public IP by default for security reasons so it is unable to reach the other server.
Hello, Nice article about tunnelling, thanks. However, I wonder if it wouldn’t be more efficient to use Mysql ssl encryption to secure the replication ? See doc here : https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html
I’m very curious to know which solution is faster, what are your thoughts about it ?
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now
Awesome thanks. I suspected as much, but was struggling to find the right article to guide me.