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

Broken Slave (MySQL replication)

Last night one of the developer ran a wrong mySQL statement (Query inserting a row with duplicate primary key) on master machine. Suddenly the replication to its slave stopped. Slave started writing it to mysql_relay_logs and before we could monitor…
Sparsh Gupta
  • 1,127
  • 7
  • 21
  • 31
2
votes
3 answers

Is it possible with MySQL to have a database-specific Master Binary Log setup?

Is it possible for me to have a unique binary log per MySQL database on my MySQL server? I've done some googling and can't seem to find any solutions. Surely there's a way!!
Ben
  • 3,800
  • 18
  • 65
  • 96
2
votes
1 answer

Redundancy for WordPress sites

For static websites I'm using HAProxy (one master, several nodes with static HTML files on them). What services in addition would you recommend to allow WordPress sites to be hosted in the same way in terms of MySQL and files across the nodes…
2
votes
1 answer

error setting up replication from mssql to mysql

I'm trying to setup replication from SQL Server 2005 to MySql 5.1.53. I am able to add the publication without any problem. However, when I go to add the subscription I get this error: OLE DB or ODBC Subscribers cannot subscribe to article…
2
votes
2 answers

MySQL Binary Logs more than 15 GB

Binary log in one of my server has grown more than 15 GB even after setting the max size to 1 GB. The MySQL server is as well not starting. Can anyone highlight what might have caused it ? Thanks.
Reena
  • 23
  • 1
  • 3
2
votes
1 answer

Full, Differential and Log backups of databases, MSSQL an MYSQL

Best I give a back story so you get the full picture. I am in the process of setting up a new business, which hopefully will start in April 2012, and as such I am preparing every aspect of it. One part of the business will be web hosting. I am quite…
Anthony
  • 367
  • 1
  • 4
  • 14
2
votes
2 answers

MySQL slave attaches production database name to new views

I have a slave database that bears a different name than it's production counterpart. (We are using the replicate-rewrite-db option.) When I run a mysqldump from the slave (which I do for making dev copies), two of the database views have the…
Mike S.
  • 143
  • 4
2
votes
3 answers

How to scale out mySQL with many Database Server (say 20 database servers)

To scale from 1 MySQL Database server to 4-5 server is very clear from the documentation by MySQL official developer website: http://dev.mysql.com/doc/refman/5.1/en/replication-solutions-scaleout.html What about scale out from 4 servers to 20…
Reusable
  • 141
  • 1
  • 4
2
votes
2 answers

Is it safe to delete MySQL binlogs (mysql-bin.*)?

I have over 500 files in my /var/lib/mysql folder named mysql-bin.000522 (or some variation thereof)...each is anywhere from a couple megabytes to 1.1GB. Overall, these files are taking up >400GB on our system. How are these being created? Are they…
2
votes
1 answer

How do you load a database with foreign keys on the master without out breaking replication?

I have a MySQL master-slave setup. One master; One slave; Lots of databases. I'm moving an app into this setup from third party. They provided a mysqldump file of the data and database structure. It contains a single database with innodb…
txyoji
  • 385
  • 6
  • 13
2
votes
1 answer

MySQL Master-Master replication generating thousands of log files

Today, I checked the /var/lib/mysql/ directory of a server in a master-master replication setup and noticed there were about 3,600 slave-relay.00xxxx files in there (where "xxxx" is an incrementing integer). They appear to be binary log files and…
Andrew Ensley
  • 932
  • 2
  • 17
  • 30
2
votes
1 answer

How to turn off the binary log for mysqld_multi instances?

MySQL supports running multiple mysqld on the same server. One of the ways is to use mysqld_multi. If the default MySQL server instance (as configured in the [mysqld] section in my.cnf) uses log-bin, it enables the binary log for all the other…
netvope
  • 2,123
  • 5
  • 25
  • 35
2
votes
2 answers

Why MySQL replication process is idle for so long time?

Time: 5280463 Status: Has sent all binlog to slave; waiting for binlog to be updated Is it okay that mysql replication process is idle for so long time?
Rihards
  • 769
  • 2
  • 12
  • 22
2
votes
4 answers

master-slave-slave replication: master will become bottleneck for writes

the mysql database has arround 2TB of data. i have a master-slave-slave replication running. the application that uses the database does read (SELECT) queries just on one of the 2 slaves and write (DELETE/INSERT/UPDATE) queries on the master. the…
JMW
  • 1,463
  • 4
  • 19
  • 27
2
votes
2 answers

Mysql cluster Vs basic Mysql db setup(not cluster)

Why mysql cluster requires more ram as compared to basic mysql db setup (no cluster)? What is the ideal ram requirement for a mysql cluster with 2 mysql servers on 2 different hosts ?
Champion
  • 51
  • 1
  • 7