Sponsored Content
Special Forums UNIX Desktop Questions & Answers How can I replicate master master and master master MySQL databse replication and HA? Post 302901678 by Palak Sharma on Thursday 15th of May 2014 01:15:26 AM
Old 05-15-2014
Question 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 servers and have installed the same application and database on both the servers.

I want to achieve something like this:


1. If the user updates (insert,delete,modify) any record on any server then the same should be replicated on the other server.

2. If one of the server goes down the other should be able to serve the request.


Kindly help me to achieve the same.
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Master Console

I was a sys admin on a HP3000. I was able to virtually move the console where ever I needed it for commands that had to be done at the master console. So I could be at home and perform some functions that you would usually have to do from the console. Now I am sys admin newbee on an AIX pseries.... (2 Replies)
Discussion started by: Beetlejuice
2 Replies

2. AIX

nim master

Hi, I want to know what are steps required to create nim master in aix? Regards, Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies

3. AIX

nim master

Hi, I want to know how to create nim master in AIX 5.3. Regards, Manoj (0 Replies)
Discussion started by: manoj.solaris
0 Replies

4. Web Development

MySQL Master-Slave Configuration: Don't Replicate a Row of a Table?

Anyone have a clue about this? I have checked the MySQL documentation and it does not seem possible to exclude a row of a table from replication between Master and Slave. It seems that replication in MySQL can only be managed at the table level, not at the row level. Does anyone know a work... (5 Replies)
Discussion started by: Neo
5 Replies

5. Red Hat

Master logs for all the operations performed on mysql DB

is there any such thing as master logs for all the operations performed on mysql database. thing is i need to find the operations performed on mysql on a linux server running on RHEL 5.7 for the past 2 days. One more thing i found out that the bin logs will be refreshed whenever server goes to... (2 Replies)
Discussion started by: vivek d r
2 Replies
MYSQLND_MS_QUERY_IS_SELECT(3)						 1					     MYSQLND_MS_QUERY_IS_SELECT(3)

mysqlnd_ms_query_is_select - Find whether to send the query to the master, the slave or the last used MySQL server

SYNOPSIS
int mysqlnd_ms_query_is_select (string $query) DESCRIPTION
Finds whether to send the query to the master, the slave or the last used MySQL server. The plugins built-in read/write split mechanism will be used to analyze the query string to make a recommendation where to send the query. The built-in read/write split mechanism is very basic and simple. The plugin will recommend sending all queries to the MySQL replication master server but those which begin with SELECT, or begin with a SQL hint which enforces sending the query to a slave server. Due to the basic but fast algorithm the plugin may propose to run some read-only statements such as SHOW TABLES on the replication master. PARAMETERS
o $query - Query string to test. RETURN VALUES
A return value of MYSQLND_MS_QUERY_USE_MASTER indicates that the query should be send to the MySQL replication master server. The function returns a value of MYSQLND_MS_QUERY_USE_SLAVE if the query can be run on a slave because it is considered read-only. A value of MYSQLND_MS_QUERY_USE_LAST_USED is returned to recommend running the query on the last used server. This can either be a MySQL replication master server or a MySQL replication slave server. If read write splitting has been disabled by setting mysqlnd_ms.disable_rw_split, the function will always return MYSQLND_MS_QUERY_USE_MASTER or MYSQLND_MS_QUERY_USE_LAST_USED. EXAMPLES
Example #1 mysqlnd_ms_query_is_select(3) example <?php function is_select($query) { switch (mysqlnd_ms_query_is_select($query)) { case MYSQLND_MS_QUERY_USE_MASTER: printf("'%s' should be run on the master. ", $query); break; case MYSQLND_MS_QUERY_USE_SLAVE: printf("'%s' should be run on a slave. ", $query); break; case MYSQLND_MS_QUERY_USE_LAST_USED: printf("'%s' should be run on the server that has run the previous query ", $query); break; default: printf("No suggestion where to run the '%s', fallback to master recommended ", $query); break; } } is_select("INSERT INTO test(id) VALUES (1)"); is_select("SELECT 1 FROM DUAL"); is_select("/*" . MYSQLND_MS_LAST_USED_SWITCH . "*/SELECT 2 FROM DUAL"); ?> The above example will output: INSERT INTO test(id) VALUES (1) should be run on the master. SELECT 1 FROM DUAL should be run on a slave. /*ms=last_used*/SELECT 2 FROM DUAL should be run on the server that has run the previous query SEE ALSO
Predefined Constants, user filter .Runtime configuration, mysqlnd_ms.disable_rw_split, mysqlnd_ms.enable. PHP Documentation Group MYSQLND_MS_QUERY_IS_SELECT(3)
All times are GMT -4. The time now is 10:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy