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
0
votes
1 answer

DB replication using BinLog

I am using mysql-binlog-connector to listen to any binlog event and then perform replication on the slave DB. My problem is that, the binlog registers event right after the execution and before commit, so if there is any rollback the event is still…
0
votes
1 answer

Mysql master-slave replication very slow

We're running a MySQL master-slave replication set-up and the slave is very slow at catching up. There seems to be no high network or cpu usage while the slave is going through the masters' logs. Connection between master and slave is stable and…
Qlii256
  • 151
  • 2
  • 8
0
votes
0 answers

Do I need binlogs with a Percona xtradb cluster?

If I am running an XtraDB cluster, with no replication, do I need binlogs? They're enabled and chewing up disk space. I'm aware I can restrict their number using max_binlog_files, but I'm not sure if I need them at all in a clustered environment. If…
0
votes
3 answers

Which MySQL Replication should I use?

I have two servers consider server 1 and server 2. There are many databases on server 1 and few active databases on server 2 as well. Can I setup MySQL replication of server 1 and server 2. If yes, what type of replication is suggested Master-Master…
0
votes
1 answer

mysql GTID replication

i try to use GTID and backdump mysql -u root -h xx.xxx.xxx.xx -p < 2015-10-30_all_database.sql Enter password: ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. and i check the slave…
王奕然
  • 101
  • 4
0
votes
3 answers

Mysql master slave replication fail PID error

I have Master on 5.6 & Slave on 5.5, this will be the test ENV to check if 5.6 can replicate on 5.5 on PROD. I am getting this below error when starting mysql ERROR! MySQL server PID file could not be found! Starting MySQL.. ERROR! The server…
AReddy
  • 101
  • 4
0
votes
2 answers

MySql Replication Force Delays

I'm maintaing one test Env in my company. And I'm uptating the test Databases as slaves of the Production ones. What I need to know is if there is anyaways of updating this specific slave just 1 or 2 times a day, not almost in realtime it is at the…
Pedro
  • 667
  • 2
  • 9
  • 20
0
votes
1 answer

MySQL proxy or Master-Master replication?

I currently have a MySQL database hosted on a remote server (Server A). This database have to stay there because this remote server is very secure. Our online website use this database to display information. The website can also insert news…
Atnaize
  • 148
  • 1
  • 1
  • 8
0
votes
1 answer

How does read/write splitting work with MySQL replication?

I know how to setup a master->slave replication but I am a bit confused on how I would do read/write splitting between the two MySQL servers with a PHP application. When I have MySQL replication working and PHP connects to the master, does it read…
user3186337
  • 85
  • 1
  • 3
  • 10
0
votes
1 answer

MariaDB auto-increment-increment having no effect

I am trying to set up a master-master MySQL replication (both active servers). As I'm doing this on Centos 7, I have to use MariaDB instead of MySQL, although it seems fairly similar. So, before I set up the replication, I am trying to set…
0
votes
2 answers

Galera new cluster WSREP Unknown error 141

I am trying to create a new Galera cluster in the cloud using Ansible (DevOps tool). I can get the cluster started by issuing commands from an SSH shell, but not from Ansible. I have simplified the configuration to two nodes, but cannot get the…
0
votes
1 answer

XtraBackup restore gives duplicates on slaving?

We've recently upgraded a MySQL 5.0 master-master setup to Percona 5.6. Slaving went b0rken due to some failures on our side, but we thought we could simply fix it by using xtrabackup to create a backup from the running server and importing it to…
0
votes
1 answer

different servers different databases replication mysql

I am not sure if this is possible or not but I have 3 servers. Server A, B and C Server A has database A_dataBase, B_database Server B has database A_dataBase, B_database and C_database Server C has database C_database Currently Server A and B are…
user50946
  • 483
  • 2
  • 7
  • 18
0
votes
0 answers

MySQL Master migration

I've run into an unforeseen issue regarding a MySQL Master node: The cloud instance on which it's installed is soon to be retired. I've not needed to perform a migration like this before, so I'm unsure if one of these options I've come up with is…
0
votes
0 answers

RDS MySQL A B replicate across continents?

I have a web app that I run for Australian customers hosted on AWS using RDS. Can I bi-directional replicate in realtime the database to the USA and Europe AND expect to be able to have a single database shared between frontend servers connecting to…
Adamz
  • 21
  • 3