MYSQL Master/Slave Replication Error

April 17, 2018 881 views
MySQL Ubuntu 16.04

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 requiresecuretransport = on

The connection error I get from SHOW SLAVE STATUS\G is below

LastIOErrno: 3159
LastIOError: 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?

3 Answers
ryanpq MOD April 17, 2018
Accepted Answer

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.

by Jesin A
This tutorial describes how to secure MySQL Replication using SSH on a VPS.

Awesome thanks. I suspected as much, but was struggling to find the right article to guide me.

  • will go through this article.

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 ?

Have another answer? Share your knowledge.