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

Replicating a linux web server

I'm planning on replicating a web server for high availability purposes. The server is running as a Ubuntu 15.04 virtual machine in Hyper-V and has MariaDB 10.0, Apache 2.4 and PHP-FPM 5.6 installed. The 2nd virtual machine will start as a direct…
gijs007
  • 107
  • 1
  • 4
  • 17
5
votes
3 answers

MySQL package upgrades (Debian apt-get) always break master-master replication due to changes in mysql schema

I have master-master replication set up on 2 Debian servers, and they replicate everything, including the mysql database itself (so that new users and such also replicate). This generally works very well, except that most, if not all, apt upgrades…
dlo
  • 451
  • 1
  • 4
  • 14
5
votes
1 answer

MySQL - Unable to enable binary logging

I'm trying to enable binary logging so that I can set up master-slave replication between two servers. I'm working with an existing server with lots of data and I'm trying to dump the data with the following command: mysqldump -u root -p…
Justin
  • 151
  • 1
  • 6
5
votes
2 answers

MySQL slave server not removing old relay binlogs

I have a MySQL server with slave replication on another host. Today I stumbled across the high disk usage of the slave host and invastigated what takes up all the space. As it turns out this space is occupied by the slaves relay logs. I tried to…
Izzy
  • 786
  • 2
  • 8
  • 29
5
votes
2 answers

Mysql replicate-rewrite-db not working

Been "slaving" on this issue all day. I have a master/slave setup that works, but when I try to replicate to a different database name on the slave it fails. This is what my.cnf looks…
Ed Manet
  • 522
  • 1
  • 5
  • 16
5
votes
5 answers

Diagnosing Mysql Replication Issues

We have a mysql replication client running on our backup server. Since a power failure last week it's stopped replicating. Before this it was running uninterrupted for several months. I've tried restarting both the master and the slave but this…
theotherreceive
  • 8,235
  • 1
  • 30
  • 44
5
votes
3 answers

Failed to connect from slave to master with error "error connecting to master (1045)"

I try to setup replication from slave to the master. CHANGE MASTER TO MASTER_HOST = 'master', MASTER_PORT = 3306, MASTER_USER = 'repl', MASTER_PASSWORD = 'xxx'; And I did grant privileges to the user on master. I can connect with mysql…
Fang-Pen Lin
  • 282
  • 1
  • 3
  • 12
5
votes
3 answers

MySQL load balancing

I'm looking into ways to balance the load on our MySQL infrastructure, and can't seem to find an answer that works for me... :) So, I have one big and fat server, that handles everything. Many DBs, many reads, many writes, etc. It handles it pretty…
Sergey
  • 928
  • 4
  • 10
  • 22
5
votes
1 answer

How to get rid of mysql binlogs?

I've been using mysql for development. I don't use replication but I guess I had binary-logging enabled for some time on one of my previous computers and I have unknowingly accumulated hundreds of binary log files. I'm using Linux now and I actually…
Stann
  • 513
  • 2
  • 7
  • 15
5
votes
2 answers

How do I add additional databases to my mysql replication slave (read-only)?

I have a mysql read-only replication slave setup and currently working for about 10 databases and I need to add 3 new databases. I cannot find any information on how to add additional information. Does anyone have some guidance on how to do…
Greg Arcara
  • 173
  • 1
  • 7
5
votes
1 answer

why use mixed-based replication for mysql

I am in the process of configuring MySQL replication and am intending to use row-based-replication but I was also reading up about mixed-based replication. This is where statement-based is the default and then for certain circumstances…
Alistair Prestidge
  • 806
  • 1
  • 7
  • 19
4
votes
2 answers

Percona MySQL 5.7 Replication error 1236 "unknown error reading log event on the master"

we are using two instances of 5.7.20-18-log (in the meantime updated to 5.7.21-21-lo) Percona Server in a master-master (dbm1 / dbm2) replication. The application only uses dbm1 for writes and reads so the dbm2 is used as a cold standby only. Since…
Adrian
  • 41
  • 3
4
votes
7 answers

Mixing Multi-Master Replication (MMR) with Linux-HA

I'm interested in using MMR (http://mysql-mmm.org/) for high availability and replication purposes. The problem is, I'm also interested in using Linux-HA for other services, such as Apache. The two overlap when it comes to certain things, such as…
imaginative
  • 1,941
  • 9
  • 32
  • 48
4
votes
3 answers

mysql master-slave setup with synchronous replication

I have a very trivial mysql master->slave setup going on between two servers. The problem is, replication is asynchronous, and this can cause issues (even on a low latency link), if the master server was to crash after a COMMIT before the…
imaginative
  • 1,941
  • 9
  • 32
  • 48
4
votes
2 answers

MariaDB Galera Cluster falls out of sync easily

We're trying to debug an issue with a MariaDB cluster. We're running Maria 10.0.19 on c4.large instances in Amazon EC2; the OS is Ubuntu 14.04 (Trusty). There are three machines clustered together, replicating fine (we can run create database foo;…
Cera
  • 533
  • 3
  • 6
  • 12
1 2
3
34 35