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.

514 questions
4
votes
1 answer

MySQL replication error: Error_code: 1032

I setup MySQL read replica that is read only. Both master and slave are running MySQL 5.6. The slave never gets written to directly, but I can't seem to keep it synced for more than an hour or two. After running for a bit, I constantly encounter…
user209180
  • 87
  • 1
  • 2
  • 6
4
votes
1 answer

Add MySQL as a resource to pacemaker

I am trying to enable fail over strategy using pacemaker on a mysql Master-Master replication on two virtual machine running openSUSE 12 created by VritualBox. I managed to complete the mysql dual-master replication, and it seems to work. Server A…
4
votes
1 answer

Using Amazon RDS (or similar) as a slave

Officially, RDS instances can't be directly set up to slave non-RDS databases. My production master is MySQL running on Hetzner and I want an RDS instance to closely follow it for backup purposes, including for the ability to actually use the RDS as…
GJ.
  • 529
  • 1
  • 7
  • 21
4
votes
1 answer

making slave server as master for another server

I have three servers, Server X, Y, and Z. I have the main mysql DB on X (innodb DB). now I have created Master-Slave from X to Y. everything is working fine here. and now i set Y as a master for Z. when i do show slave status on Z (the third…
Alaa Alomari
  • 638
  • 5
  • 18
  • 37
4
votes
3 answers

Database scalability with write-heavy application

I have a write-heavy application. The application is best compared to surveys - the customer creates custom questionares and this is saved to the database. Most of the requests are from their users submitting these forms. Later on our customers do…
Luke
  • 1,892
  • 4
  • 22
  • 27
4
votes
2 answers

Are Master-Master database collisions a problem even with auto increment?

I've done quite a lot of reading into this and I'm still I'm not sure where I stand. Am I going to get database collisions (and then corruption) with two Masters both receiving writes ? Now that MySQL (I'm using 5.1 on Debian and Ubuntu) has…
Jonathan Ross
  • 2,173
  • 11
  • 14
4
votes
2 answers

Why does MySQL replication break on missing row, then continue after "START SLAVE"?

The title is a bit confusing, but I can't think of a better one. What I have is a simple vanilla MySQL replication, with the slave occasionally failing, with this error: Error 'Can't find record in 'my_tbl'' on query. Default database: 'my_db'.…
shlomoid
  • 289
  • 3
  • 14
4
votes
2 answers

MySQL - If slave is offline and comes back online, does it automatically catch data from master?

MySQL - If slave is offline for a few hours and comes back online, does it automatically catch data from master?
Mike
  • 45
  • 1
  • 3
4
votes
2 answers

MySQL replication: Getting the master in sync with the slave again

I have two computers on the same network, in a master-slave replication setup. Simply to test failover, I inserted some data straight into the slave database. So now the slave database contains more information than the master database. Now I want…
Deniz Dogan
  • 143
  • 3
3
votes
1 answer

AWS RDS MySQL Replication with user with REQUIRE SSL

I'm trying to set up a MySQL read replica on AWS RDS. The user for the slave (rdsrepladmin) has the REQUIRE SSL flag set. This causes the read replica server to enter a perpetual 'read replication: connecting' state. So, I'm read that I need to (on…
Jacco
  • 377
  • 5
  • 14
3
votes
1 answer

MySQL Multi-source replication from 5.6 masters to 5.7 slave

In MySQL 5.7 multi-source replication is finally available. Is it possible to use several MySQL servers running version 5.6 as multiple masters for a single MySQL slave running 5.7? Or do you have to upgrade all the masters to 5.7 to allow them to…
Henrik
  • 31
  • 2
3
votes
3 answers

mysql best practices with replication of the mysql db (grants storage)

is there a best practice to ensure that privileges do not get replicated to mysql slave servers? the problem is, there a maintenance users in the mysql table that have different passwords on each box. things like startup/shutdown scripts use these…
imaginative
  • 1,941
  • 9
  • 32
  • 48
3
votes
1 answer

Multi-state MySQL master/slave pacemaker resource fails to launch on cluster nodes

Setup I'm setting up an HA cluster for a web application using two physical servers in a Corosync/Pacemaker managed cluster. After finding out I was heading the wrong way, I decided to use heartbeat's bundled MySQL resource agent to manage my MySQL…
Habovh
  • 271
  • 3
  • 12
3
votes
0 answers

Get floating ip from mmm to work on Tinc vpn on Ubuntu

I've got 3 ubuntu servers connected with a Tinc VPN right now. 2 servers are running mysql 5.6 db's, and the 3rd is used only as a monitor. We're using mmm to do the monitoring and assign a floating ip to a writer role. (Before someone tells me that…
Inukshuk
  • 165
  • 1
  • 2
  • 10
3
votes
1 answer

Best practices to backup mysql databases

This question concerns best practices for mysql backup with replication and large number of databases. I'm looking for your point of view and suggestions :) I - Current situation I have two databases master/slave (mysql replication) on each one of…