Questions tagged [mysql-replication]

Replication enables data from one MySQL database server (the master) to be replicated to one or more MySQL database servers (the slaves).

Replication enables data from one MySQL database server (the master) to be replicated to one or more MySQL database servers (the slaves). Replication is asynchronous - slaves need not be connected permanently to receive updates from the master. This means that updates can occur over long-distance connections and even over temporary or intermittent connections such as a dial-up service. Depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database.

The target uses for replication in MySQL include:

  • Scale-out solutions - spreading the load among multiple slaves to improve performance. In this environment, all writes and updates must take place on the master server. Reads, however, may take place on one or more slaves. This model can improve the performance of writes (since the master is dedicated to updates), while dramatically increasing read speed across an increasing number of slaves.

  • Data security - because data is replicated to the slave, and the slave can pause the replication process, it is possible to run backup services on the slave without corrupting the corresponding master data.

  • Analytics - live data can be created on the master, while the analysis of the information can take place on the slave without affecting the performance of the master.

  • Long-distance data distribution - if a branch office would like to work with a copy of your main data, you can use replication to create a local copy of the data for their use without requiring permanent access to the master.

519 questions
3
votes
2 answers

Why is MySQL Replication so complicated?

It seems so simple: I have two servers running MySQL, one has a nice big database of important stuff, the other is an empty shell ready to be used as a replication slave. These are the steps I should need to take to set up replication: Add a user…
Jimmy
  • 293
  • 3
  • 7
2
votes
2 answers

Automaticaly restoring SQL replication after power outage

I have two Sql databases, "MASTER" and "SLAVE", and I use Sql replication to get them synchronized. I'm using MariaDB 10 on both databases. The MASTER database is installed on a linux PLC using Docker. The SLAVE is on a NAS server, using Docker…
2
votes
1 answer

Amazon Aurora read-only slaves slowly increase to 100% CPU and die

We have a master database instance hosted on AWS Aurora (mysql) and have many read-only slaves being replicated from it. The master and the 4-12 autoscaling slaves are currently of db.r4.4xlarge size and engine version: 5.7.12. Each slave comes…
2
votes
0 answers

Converting Mariadb Galera Cluster into Simple Master Slave Replication Cluster

Now we have this project to convert our Mariadb Galera Cluster (3 nodes) to Simple Master Slave cluster (One master and two slaves). So our goal to get rid of Galera and make our setup just async / semisync Master Slave cluster. We have big tables…
2
votes
1 answer

mariadb replication over ssh tunnel

I'm trying to do mariadb replication over a ssh tunnel. Here is my config. First, I created a ssh tunnel from my replication server(R1) to my Master server (M1). ssh -L 13306:localhost:3306 -p 22111 admin@M1 -f -N Both the mariadb instances are…
2
votes
1 answer

Fix MySQL group_replication applier module failed to start

TL/DR: this question is not about master-slave replication. It is about NEW feature of multi-master group-replication (available starting v5.7.17). We have working workaround, but it takes hours due to large amount of data that needs to be imported…
Alexey Kamenskiy
  • 794
  • 1
  • 9
  • 23
2
votes
1 answer

How to add new slave server to existing Mysql master slave replication

I have a Mysql Master server and Slave replication on Amazon Ec2 instance. Currently need to add new slave server to this loop. I can take AMI of existing slave server and spin new slave server. How to add new slave server to existing slave server…
adminz
  • 397
  • 2
  • 6
  • 20
2
votes
1 answer

Multi source replication not working in MySQL

I am trying to setup multi source replication. In my slave I have defined following two properties in its configuration file. master-info-repository=table relay-log-info-repository=table These entries are needed because I am defining channels in…
Frank Martin
  • 741
  • 2
  • 12
  • 24
2
votes
1 answer

Best way to migrate a large database from EC2 to RDS MySQL

I currently have my database on a MySQL server hosted in a dedicated EC2 instance and planning to migrate the DB to a RDS backed MySQL server. Now the issue I have is with migrating the data from EC2 to RDS. The database is nearly 185 GB and at…
2
votes
1 answer

Mysql GTID replication stopped working

I've setup mysql gtid replication between master and slave. the interesting thing is that I found the replication stopped working after several minutes, and I have to use stop slave and start slave to restart mysql replication. Can anyone tell me…
technoob
  • 142
  • 1
  • 14
2
votes
0 answers

MySQL replication broken as binlog not in chronological order

Looking at an excerpt from the binary log, it can be seen that these 2 statements are written to the log out of order chronologically: #160628 17:32:46 server id 2220 end_log_pos 64812204 Query thread_id=157061 exec_time=0 …
2
votes
0 answers

MySQL slave index file corruption

I have a MySQL master-slave replication pair, and to take backups, I run a script that stops the slave, dumps the database, and then re-starts the slave. However, after restarting, the slave's MySQL daemon (mysqld) fails due to corruption in the…
John
  • 9,070
  • 1
  • 29
  • 34
2
votes
2 answers

GTID have been turned off But I have error in replication

I just upgrade from mariadb5 to mariadb10. Then I have error on my slave replication Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist My master for this replication does not using…
2
votes
2 answers

Help me understand mk-heartbeat

Seconds_Behind_Master from SHOW SLAVE STATUS is considered an unreliable measure of Slave lag. mk-heartbeat is often offered as a reliable alternative. Now mk-heartbeat does not even need the Slave to be…
HTTP500
  • 4,833
  • 4
  • 23
  • 31
2
votes
2 answers

How to open the MySQL port only to Amazon RDS for replication?

I have a MySQL database on a dedicated server, that I want to replicate to Amazon RDS to always have an up-to-date backup. For this, Amazon RDS needs to be able to connect to my master MySQL server. I do not want to open the MySQL port 3306 to the…
BenMorel
  • 4,507
  • 10
  • 57
  • 85