LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-29-2004, 09:05 AM   #1
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Rep: Reputation: 15
mysql replication


Hi All,
Wanted to see if anyone ran into this problem before. I got two MySQL servers to see each other as their master server. So any updates that any one gets, the other server gets as well. This works okay until I reboot a machine. When it comes back up, it is missing data. Now I figured out that it isn't just any data. Here is how it works.

Server A gets some data X, and records it to it's database while server B reads it off, and records it as well. Next server B gets Y data to it's database (note that I am careful not to allow both to be receiving data at the same time) and server A reads it off, and records that data as well. So both servers have the X data, then the Y data. So I reboot server A, and when it comes back, X data (the data that was not replicated to it) has disappeared! This has happened a couple of times. I have made sure that when I initially set up the replication that the CHANGE MASTER TO MASTER_LOG_POS= is correct but that doesn't seem to work.

Another question . . . How do you zero-out the position? Would it do any good to do that in this case?

Thanks,
Pair
 
Old 03-29-2004, 12:02 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Moved to Linux->General
 
Old 03-29-2004, 12:50 PM   #3
jsokko
Member
 
Registered: Mar 2004
Location: Phila, PA
Distribution: SuSE 9.0 / RH 9 / Slackware 9.1
Posts: 110

Rep: Reputation: 15
The topic of A - B - A replication is a contentious topic for MySQL and most agree that it's not the ideal setup. What is the purpose, really -- unless they are separate DBs you've set:

Box 1 | Box2
-------- | ----------
DB-A[Master] | DB-A[Slave]
DB-B[Slave] | DB-B[Master]

What is your setup?

Last edited by jsokko; 03-29-2004 at 12:51 PM.
 
Old 03-29-2004, 03:09 PM   #4
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
I agree, and I was basically trying to make the best of it, and see how well I could get it to work. To update the thread, I was able to get it to work the way I wanted. I must have done something wrong the first time, and when I set it up the second time, it just worked. Both machines have logging to the database, and I wanted to be sure that each machine carried the same logging information that the other has, so that if one goes down, the other can still serve up the logs. Since only one machine will be logging at a single time, and data will never be streaming into both machines at once, there should be no conflicting data.

My general perception in reading around was that it seems almost like the red-headed step-child technology of MySQL. In my preliminary testing though, I actually really like it for what I am doing. Hopefully that tech will mature because I think there is a lot of demand for it. Incidentally I have it sorta set up like this:

Box1 | Box2
Master DB-A | Slave DB-A
Slave DB-A | Master DB-A

So basically each machine is a master and slave for the other.

Thanks,
-Pair

Quote:
Originally posted by jsokko
The topic of A - B - A replication is a contentious topic for MySQL and most agree that it's not the ideal setup. What is the purpose, really -- unless they are separate DBs you've set:

Box 1 | Box2
-------- | ----------
DB-A[Master] | DB-A[Slave]
DB-B[Slave] | DB-B[Master]

What is your setup?
 
Old 03-29-2004, 03:16 PM   #5
jsokko
Member
 
Registered: Mar 2004
Location: Phila, PA
Distribution: SuSE 9.0 / RH 9 / Slackware 9.1
Posts: 110

Rep: Reputation: 15
You do know that you're still going to have to manually switch users over to the slave machine, right? there's no automatic failover in case the Master goes down... look into linux-HA if you're interested in building a simple two node cluster with IP/service takeover.

Oh, I forgot to mention and boost the availability of MySQL Administrator (ALPHA) on their site. It makes a handy tool along with their beta of MySQLCC. I highly recommend the tools for anyone using MySQL.

Last edited by jsokko; 03-29-2004 at 03:29 PM.
 
Old 03-29-2004, 04:23 PM   #6
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
Affirmative on both accounts. I have Heartbeat running on both machines, so if one goes down, the other picks up for it. That is at the machine-level though. I need something that will cross-monitor the services on each machine, and take actions accordingly. Looks like Mon only handles alerts, and doesn't care too much about recovery (at least from what I can tell at the moment). So I am looking into other solutions.

I am also using the MySQL Administrator, and the Control Center. Pretty cool so far! They seem a LITTLE limited however. I can get a lot more done at the command-line, but I really like them thus far. If you have any more suggestions I welcome them, and if not, thank you for all of your help!

Thanks,
Pair

Quote:
Originally posted by jsokko
You do know that you're still going to have to manually switch users over to the slave machine, right? there's no automatic failover in case the Master goes down... look into linux-HA if you're interested in building a simple two node cluster with IP/service takeover.

Oh, I forgot to mention and boost the availability of MySQL Administrator (ALPHA) on their site. It makes a handy tool along with their beta of MySQLCC. I highly recommend the tools for anyone using MySQL.
 
Old 03-29-2004, 04:28 PM   #7
jsokko
Member
 
Registered: Mar 2004
Location: Phila, PA
Distribution: SuSE 9.0 / RH 9 / Slackware 9.1
Posts: 110

Rep: Reputation: 15
I'd highly suggest looking at the full HA package and not just heartbeat. They use FAKE for the IP failover and have the ables you to specify which services you want switched at machine failure. Go to their site : www.linux-ha.org and google for docs and how-tos.


yeah... I can't wait until 4.1 becomes stable along with Administrator. Administrator is going to make replication easy(ier).
 
Old 06-23-2006, 10:10 AM   #8
XOR007
Member
 
Registered: May 2005
Location: Africa
Distribution: Ubuntu, Redhat 6.2 to 9, Centos 4, Suse 8 Ent.,Suse 9 Ent.
Posts: 51

Rep: Reputation: 15
Hi All.

SORRY FOR CROSSPOSTING, I am desperate.

I have setup replication with 1 slave PC1 and 1 master: PC2

inserts, deletes, updates ... on the master get replicated to the slave. but I tried to insert on the slave it does not replicate go the master. Is that normal? Is there a slave flag that I must set to allow it to update the master when it comes back online?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CVS and Replication Satriani Programming 1 08-26-2005 11:46 AM
MySQL Replication not working correctly? Ratclaws Linux - Software 0 06-20-2005 03:34 PM
Looking for suggestions on MySQL one-way replication Pcghost Linux - Software 1 01-25-2005 10:22 AM
Mysql replication pk21 Linux - Software 0 08-28-2003 05:00 AM
mysql replication cheng Linux - Software 1 08-22-2002 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration