2

So I've been trying to configure MariaDB replication for our server. Unfortunately I cannot get it replicating correctly.

So I've followed the MariaDB guide to the letter to get replication set up. Master and slave are configured and the slave is set connect to the master. The slave shows the error as:

Lost connection to server at 'waiting for initial communication packet', system error:110 "connection timed out".

I've noticed that I am unable to login to the master from the slave with -u root -p -h xxx.xxx.xxx.xxx. Though the servers are able to ping one another and all ports are allowed between the two, I can ssh between them and transfer files. Both replication and root users have the required permissions to login remotely and locally.

So I trawled google and implemented some changes to try and further diagnose the issue, such as bind address changes and max packet size. But no luck. I also noticed I am unable to login to the master from the master if I specify its IP address rather than just localhost. I get the error:

ERROR 1045 (28000):access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES).

Any ideas will be much appreciated!

Master is running the following: Ubuntu server 16:04, MariaDB 10.0.38

Slave is running: Ubuntu server 20.04, MariaDB 10.5.4

  • looks like user - host set up issue first disable any firewall on both servers on the master - create a replication user and grant replication previliges - user should be something like replicationUser@slaveServerIp master bind addresses should be = master server ip master and slave each should have a unique server id you should then be able to login from the slave seever to master using replicationUser also try to kerp master and slave server environment sband versions similar ( ubuntu and mariadb version s ) – itz_nsn Aug 14 at 6:36
0

I think this is a good clue to what is wrong:

I also noticed I am unable to login to the master from the master if I specify its IP address rather than just localhost.

It seems as if you don't have the right host specified for the user you have created. In MariaDB and MySQL when you create a user you also need to specify a "host". This can e.g. be a specific IP address to allow connections from that IP address only, or it can be a wildcard to allow connections from all hosts, or a partial IP address combined with a wildcard:

CREATE USER replication_user@'%' IDENTIFIED BY 'super_secret_password';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.