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
2
votes
0 answers

MySQL persistent tmpdir on slave: use tmpdir or slave_load_tmpdir only?

While setting up a replicated MySQL database I looked at the manual about tmpdir and was somewhat confused about the two variables tmpdir and slave_load_tmpdir. I know the slave needs some data to be persistent between restarts, but I am not sure if…
lmz
  • 379
  • 2
  • 4
  • 17
2
votes
1 answer

How to secure the db dump taken from daily run script

In one of my mysql slave servers I have written a daily run script, which 1) stops slave, 2) takes a db dump, 3) starts slave again, 4) encrypts it, 5) copies it to my s3-bucket. I am using aws-cli to copy the dump to s3-bucket. The issue here is…
2
votes
1 answer

Hard reboot causes MySQL replication to break

I have encountered an issue with my replication setup. Under normal circumstances it performs as intended, but it breaks if it encounters a hard reboot (I pull the power cable). Setup The setup consists of two servers, server-1 and server-2. The…
2
votes
2 answers

What would be a stable, failproof, scalable galera cluster implementation

Context: We are using a MariaDB Gallera cluster with (only) 2 master nodes for a web application. Last night we had a power failure and now we can't seem to recover the data and found out the database was corrupt on both nodes. Our initial…
Malitta N
  • 31
  • 8
2
votes
1 answer

MySQL Replication: Don't propagate failed queries to slaves

I have a simple MySQL replication setup with one master and two slaves. Occasionally there are queries that get executed on the Master which fail due to duplicate unique keys or other reasons. What I'm seeing is that the failing queries are…
curtisdf
  • 251
  • 1
  • 3
  • 13
2
votes
1 answer

check_mysql_slavestatus RPE: Unable to read output

i am using Nrpe plugin on Ubuntu from nagios exchange check_mysql_slavestatus. Manually its working from : root@Bastion-01:/usr/local/nagios/libexec# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20 OK: Slave SQL running:…
Ashish Karpe
  • 277
  • 2
  • 5
  • 19
2
votes
0 answers

Create RDS Read-Replicate in a separate region using VPC

We have a MySQL RDS instance in a VPC, and want to setup a read-replicata in another region. Unfortunately since our RDS instance is in a VPC, we don't appear to have the option to replicate across regions. The documentation isn't clear, but seems…
James Davies
  • 273
  • 2
  • 3
  • 6
2
votes
1 answer

MySQL replication slowing master

We are currently running MySQL 5.1 Quick Overview We use 5 web servers ( Apache ) all connected to 1 DB server ( MySQL ) hosted on the cloud. The DB server running on the cloud ( Master ) replicates to a local DB server ( Slave ) here at our…
go0n
  • 59
  • 1
  • 6
2
votes
3 answers

MySQL - Does the change in MySQL master db password affect on slave db?

I want to change the MySQL DB password on the master db. My question is: do we have to care for the slave DB when changing the master database password?
Milos Cuculovic
  • 423
  • 3
  • 8
  • 22
2
votes
1 answer

mySQL 'Stop Slave' on Server Reboot

Is there a way in mySQL to issue a 'stop slave' command when the server is rebooted to prevent the replication from getting out of sync? I haven't been able to find anything definitive on this.
acvcu
  • 21
  • 2
2
votes
2 answers

What prevents loops in mysql master-master setups?

I have two servers running mysql as dual master (each server is a master, each server is slaved to the other). While troubleshooting a possible issue during peak load, I began to wonder how mysql prevent a "loop" of commands in a relationship like…
jj33
  • 11,178
  • 1
  • 37
  • 50
2
votes
2 answers

MySQL Replication Over SSH - Last_IO_Errno: 2003 - error connecting to master

I have MySQL MASTER/SLAVE replication working on two test boxes (Centos 6.4 / MySQL 5.5.32) over LAN. Securing the connection over ssh causes connection problems from the SLAVE machine: (Sample of show slave status \G Output) Last_IO_Errno:…
Dom
  • 75
  • 1
  • 11
2
votes
1 answer

What are the options for any SQL Multi Master Master replication?

I am looking for a proper way to do Multi Master Master replication. I am currently using MySQL but open to switching to Postgres or Oracle if needed. So far the only solution I find is tungsten-replicator from Continuent. Looking for similar or…
smorhaim
  • 229
  • 1
  • 7
2
votes
1 answer

MySQL Master-Slave Replication

I am trying to set up highly-available master-slave MySQL replication. I plan to have two servers on different networks with one running as master and the other running as slave like so: A B 10.0.1.0/24 |…
Ethan Hayon
  • 235
  • 1
  • 6
2
votes
2 answers

mySQL: Slave not able to connect to Master for replication

On my master, I did: GRANT REPLICATION SLAVE ON *.* TO 'repluser'@'%' IDENTIFIED BY 'mypassword'; On my slave, I see: mysql> show slave status \G; *************************** 1. row *************************** Slave_IO_State:…
Shamoon
  • 911
  • 4
  • 14
  • 22