Sponsored Content
Top Forums Web Development MySQL Master-Slave Configuration: Don't Replicate a Row of a Table? Post 302461246 by Neo on Saturday 9th of October 2010 11:58:51 AM
Old 10-09-2010
Quote:
Originally Posted by radoulov
Neo,
I assume these options are static so you could take a dump of the production db (use --master-data), then import the data in the slave, update the rows on the slave with the proper configuration and then start the replication. As far as those rows remain untouched on the master, the slave configuration will remain valid.
Thanks!

That is exactly what I've been doing (manually). The part I wish to avoid is editing the slave each time I upload the masterdump data into the slave.

In addition to the static data, some data is dynamic, and I want the data on the slave and master to remain unique to each other (secondary requirement, not a show stopper).

For example, when replicating this vB forum, static information is, for example, the URL of the forum (they are different in the test environment), and dynamic information is the number of users on the site. This information comes from a table called "datastore" which contains rows with various static configuration / option data and dynamic data, like who is on the site, spiders, number of users on line, etc.

If I replicate the entire datastore table, I have problem when I turn off vB plugins on the slave that remain on on the master. Yes, I can work around by manually updating the configuration on the slave each time; but then if I turn off a plugin (or turn on a dormant one) on the master, it will update the slave, which I don't want.

That's why I was hoping there was some way to just exclude some rows in the datastore table from replicating.

Also, I thought about perhaps instructing the slave to permanently lock the rows so they can't be effected by uploading a dump or master replication.

Maybe that will work?
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

NIS master / slave problems

Our NIS master server went down. We have since fixed it and brought it back up. However all of are machines still point to the slave server when looking at it with ypwhich. My question is how do i point the servers back to the master. Frank (2 Replies)
Discussion started by: frankkahle
2 Replies

2. SCO

master and slave in lan network

hello , i setup a lan network , but i don't know how configure master and slave in the lan network please help me:confused: (2 Replies)
Discussion started by: hossein
2 Replies

3. AIX

Slave NIS server configuration change

Hello Everybody, I have a question regarding SLAVE NIS SERVER in aix. We are using NIS master of Sun Solaris 9.0 which is on different subnet i.e. 10.197.93.0. And Our slave server is having AIX 5.3 installed which is on 10.207.13.0 subnet. I have a query regarding its name and ip address... (0 Replies)
Discussion started by: jit15975
0 Replies

4. Shell Programming and Scripting

mysql how to select a specific row from a table

i have a table records ------------ id | user | time | event 91 admin | 12:00 | hi 92 admin | 11:00 | hi 93 admin | 12:00 | bye 94 admin | 13:00 | bye 95 root | 12:00 | hi 96 root | 12:30 | hi 97 root | 12:56 | hi how could i only select and display only the user and event from... (6 Replies)
Discussion started by: kpddong
6 Replies

5. Programming

Asynchronous communication between master and slave threads

I am writing a process that has a master thread and a set of slave threads. Master thread is supposed to get jobs dynamically and assign to slave thread which is free. Master also get results back from slaves once a job is done. The number of slaves should be adjustable dynamically based on job... (1 Reply)
Discussion started by: tamil.pamaran
1 Replies

6. UNIX Desktop Questions & Answers

How can I replicate master master and master master MySQL databse replication and HA?

I have an application desigend in PHP and MySQl running on apache web server that I is running on a Amazon EC2 server Centos. I want to implement the master-master and master slave replication and high availability disaster recovery on this application database. For this I have created two... (0 Replies)
Discussion started by: Palak Sharma
0 Replies

7. Programming

How to wait the slave to be finished first then execute the master--MPI C++?

Hi, How to wait the slave to be finished first then execute the master? Can someone give me the specific function? Or the detailed example. Thanks~ (1 Reply)
Discussion started by: wanliushao
1 Replies

8. IP Networking

DNS question about initial Master/Slave setup

Hey everyone. I'm creating a DNS master/slave server set up. I have the configurations all done I believe, the master has the required zone file, and the named.conf file has the allow transfer and allow query stuff set. The slave has it's own configs set. My question is that when initially... (1 Reply)
Discussion started by: Lost in Cyberia
1 Replies
OCF_HEARTBEAT_MYSQL(7)						OCF resource agents					    OCF_HEARTBEAT_MYSQL(7)

NAME
ocf_heartbeat_mysql - Manages a MySQL database instance SYNOPSIS
mysql [start | stop | status | monitor | promote | demote | notify | validate-all | meta-data] DESCRIPTION
Resource script for MySQL. May manage a standalone MySQL database, a clone set with externally managed replication, or a complete master/slave replication setup. SUPPORTED PARAMETERS
binary Location of the MySQL server binary (optional, string, default /usr/bin/mysqld_safe) client_binary Location of the MySQL client binary (optional, string, default mysql) config Configuration file (optional, string, default /etc/my.cnf) datadir Directory containing databases (optional, string, default /var/lib/mysql) user User running MySQL daemon (optional, string, default mysql) group Group running MySQL daemon (for logfile and directory permissions) (optional, string, default mysql) log The logfile to be used for mysqld. (optional, string, default /var/log/mysqld.log) pid The pidfile to be used for mysqld. (optional, string, default /var/lib/mysql/mysqld.pid) socket The socket to be used for mysqld. (optional, string, default /var/lib/mysql/mysql.sock) test_table Table to be tested in monitor statement (in database.table notation) (optional, string, default mysql.user) test_user MySQL test user (optional, string, default root) test_passwd MySQL test user password (optional, string, no default) enable_creation If the MySQL database does not exist, it will be created (optional, integer, default 0) additional_parameters Additional parameters which are passed to the mysqld on startup. (e.g. --skip-external-locking or --skip-grant-tables) (optional, string, no default) replication_user MySQL replication user. This user is used for starting and stopping MySQL replication, for setting and resetting the master host, and for setting and unsetting read-only mode. Because of that, this user must have SUPER, REPLICATION SLAVE, REPLICATION CLIENT, and PROCESS privileges on all nodes within the cluster. (optional, string, no default) replication_passwd MySQL replication password. Used for replication client and slave. (optional, string, no default) replication_port The port on which the Master MySQL instance is listening. (optional, string, default 3306) max_slave_lag The maximum number of seconds a replication slave is allowed to lag behind its master. Do not set this to zero. What the cluster manager does in case a slave exceeds this maximum lag is determined by the evict_outdated_slaves parameter. (optional, integer, default 3600) evict_outdated_slaves If set to true, any slave which is more than max_slave_lag seconds behind the master has its MySQL instance shut down. If this parameter is set to false in a primitive or clone resource, it is simply ignored. If set to false in a master/slave resource, then exceeding the maximum slave lag will merely push down the master preference so the lagging slave is never promoted to the new master. (optional, boolean, default false) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 120. stop Stops the resource. Suggested minimum timeout: 120. status Performs a status check. Suggested minimum timeout: 60. monitor Performs a detailed status check. Suggested minimum timeout: 30. Suggested interval: 10. promote Promotes the resource to the Master role. Suggested minimum timeout: 120. demote Demotes the resource to the Slave role. Suggested minimum timeout: 120. notify Suggested minimum timeout: 90. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 5. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. EXAMPLE
The following is an example configuration for a mysql resource using the crm(8) shell: primitive example_mysql ocf:heartbeat:mysql op monitor depth="0" timeout="30" interval="10" SEE ALSO
http://www.linux-ha.org/wiki/mysql_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents 1.0.3 07/05/2010 OCF_HEARTBEAT_MYSQL(7)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy