question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MySql slaves on Amazon EC2 RHEL 7.6 server not getting connected automatically after mysql service restart on master

See original GitHub issue

I have setup MySQL Master - slave replication on Amazon EC2 instance. OS : RHEL 7.6 MySQL Version: 8.0.13 Mater server IP : 192.168.1.128 Slave server IP : 192.168.1.129

I have two ec2 instance on which i have configured one ec2 as Master and another one as its slave. I have created user “replicator” on master server for replication with " %" host. After executing change master statement on slave server as mentioned below.

CHANGE MASTER TO MASTER_HOST='192.168.1.128',MASTER_USER='replicator', MASTER_PASSWORD='Replication@123', MASTER_HEARTBEAT_PERIOD=5, MASTER_LOG_FILE='mysql-bin.000063', MASTER_LOG_POS=195;

I have executed start slave and show slave status\G command on slave server i.e. on 192.168.1.129 . i have got following error:

   Slave_IO_State: Connecting to master
     Master_Host: 192.168.1.128
     Master_User: replicator
Slave_IO_Running: Connecting

Slave_SQL_Running: Yes Last_IO_Error: error connecting to master 'replication@192.168.1.128:3306' - retry-time: 60 retries: 8

Then i have taken login to master mysql server from slave server i.e. mysql -u replicator -p -h192.168.1.128 slave started sucessfully.

show slave status\G ouput:

    Slave_IO_Running: Yes
   Slave_SQL_Running: Yes

After all these i came to know that i have to repeat this step i.e. mysql -u replicator -p -h192.168.1.128 from slave server every time whenever master MySQL services restart. Otherwise replication will not start and will get same error as describe above i,e. error connecting to master ‘replication@192.168.1.128:3306’

So can anyone help to fixed this issue.

Thanks in Advance

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Mar 5, 2019

Oh, I used the word support instead of contact, which lead me to https://www.mysql.com/support/

0reactions
dougwilsoncommented, Mar 6, 2019

So Oracle is the company who writes the mysql server software. I have never tried to get support from them before, so not sure if there is some kind of free support method or not off hand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySql slaves on Amazon EC2 RHEL 7.6 server not getting ...
I have setup MySQL Master - slave replication on Amazon EC2 instance. OS : RHEL 7.6 MySQL Version: 8.0.13. Mater server IP :...
Read more >
MySQL master slave replica interrupts after service restart or ...
I noticed that unfortunately every time the mySQL service restarts, or one of the server is rebooted, the replica stops to work and...
Read more >
AWS MySQL Replication : Master-slave - 2020 - BogoToBogo
Master -slave data replication allows us to easily maintain multiple copies of a MySQL data by having them copied automatically from a master...
Read more >
16.1.6.4 Binary Logging Options and Variables
When GTIDs are in use on the server, if binary logging is not enabled when restarting the server after an abnormal shutdown, some...
Read more >
MySQL replication for high availability - Severalnines
Replication enables data from one MySQL server (the master) to be replicated ... This is not that big of an issue as the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found