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
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…
3
votes
3 answers

MariaDB replication lag

I'm trying to get replication working between 2 servers running MariaDB 10.1.7 64 bit. The database I'm trying to replicate is huge, 520G and the export/import on the slave with disabled autocommits took 5 days. When I initially started the…
Mugurel
  • 903
  • 1
  • 9
  • 17
3
votes
1 answer

High Mysql Connections

Having a challenge discovering why results are as they are. Perhaps missing something obvious. Sorry this isn't very specific. But if anyone has an pointers on areas to focus on that would be very helpful. Cheers. Load Test Its about 5486 writes…
3
votes
2 answers

MySQL Master-Master Replication Slave Thread Issue

I'm currently trying to set up Master-Master MySQL replication between 2 servers, but I'm encountering an unusual issue. I'm getting this error on my MySQL log: Slave: Table 'phpmyadmin.pma_recent' doesn't exist Error_code: 1146 And I'm seeing that…
user207054
3
votes
1 answer

Restore database by files from broken Ubuntu server

I'm pretty lost right now. The RAID controller auf my server broke and all attached hard drives were corrupted. Luckily I copied the plain files off the server right before the crash (phew). I set up the new server with Ubuntu 12.04 and a fresh…
3
votes
1 answer

Is it safe to lock tables on a mysql replica slave?

I have a master mysql database where the application writes and read production data, and then I setup a slave database just in case something goes wrong with the master database server (and I can do a quick switch). On the slave database, I run…
rorra
  • 207
  • 1
  • 2
  • 6
3
votes
2 answers

MySql server master-master seconds_behind_master jumps

I'm running a 4 servers master-master cluster of MySql. (2 servers version 5.1, and 2 version 5.5) While checking the slave status, i see the seconds_behind_master at 0, and half a second after i see it jumps to 2000, and so fourth. What could it…
shaharmor
  • 337
  • 4
  • 16
3
votes
1 answer

MySQL slave replication Seconds behind master increasing?

I started a MySQL slave using innobackupexand the Read_Master_Log_Pos: and the Relay_Log_Pos: are updating however the seconds behind master keeps on increasing (it's at Seconds_Behind_Master:496637 currently and increasing). Any ideas on how to fix…
ks_1010
  • 121
  • 1
  • 2
  • 8
3
votes
1 answer

MySQL master-slave lag replication

Our company is using TokuDB on production and we are having a lot of problems trying to mitigate lag on our slave. Is very strange, because we're talking about very few rows... but with a few data it gets lagged. Slave is a read-only DB. For more…
blacksoul
  • 252
  • 7
  • 22
3
votes
3 answers

Mysql dump of slave w/o missing Master data

I am fairly new to the whole replication process of mysql so this may be an easy question to answer. I have a master and and slave. I need to set up another slave so obviously I will need to make the dump from the current slave because I CAN NOT…
pickledtink
  • 73
  • 1
  • 5
3
votes
2 answers

MySQL Replication 'Catchup' UPDATES keep newer record

I've got two MySQL clusters that have Master-Master replication setup between them. Most tables are log based, with only inserts and selects, so they don't have any problems with the replication. However, I have a few tables that hold current…
giggsey
  • 83
  • 1
  • 1
  • 9
3
votes
3 answers

MySQL replication automation?

I was wondering if there are any MySQL replication automators or managers that can take over the tasks of deploying MySQL slaves from a master. I come from an old school server management background, so I'm familiar with setting up MySQL replication…
Kevin
  • 31
  • 2
3
votes
4 answers

Replicate main MySql db to a development server to play with real data

I have a main architecture with a MySql db, replication and backup, it's working fine. Now I also have a development server where I play with the code and I would like to use the data from the main db to play too, with reads and writes. How can I…
Bastian
  • 283
  • 3
  • 16
3
votes
3 answers

MySQL Master-Master Replication Lag

I have configured two MySQL servers (MySQL-1, MySQL-2) in master-master replication in the same datacenter using a local backend connection with the following options: innodb_flush_log_at_trx_commit=1 sync_binlog=1 We use a load balancer to round…
Justin
  • 5,328
  • 19
  • 64
  • 84