Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th September 2008, 17:56
marchost marchost is offline
Junior Member
 
Join Date: Feb 2008
Posts: 27
Thanks: 1
Thanked 4 Times in 4 Posts
Default Master Master replication questions and problems

I set up a master master replication as explained by falko how-to.

It works but I ran in some problems.

Let say there is a replication between server1 and server2 (master-master)

1)If server1 reboot, will it resync automatically with server2 upon restart?

From what Ive seen, it doesnt seem to resync automatically but maybe I did something wrong.

Everytime I reboot a machine I have to :

stop slave;
reset slave;
reset master;
start slave;

because log position is not the same...

on both machines and then find tables that are not in sync with maatkit :

#mk-table-checksum h=server1,u=root,p=pass h=server2,u=root,p=pass | mk-checksum-filter

and resync tables - in this example table1 on db1 (on server1 that rebooted):

mk-table-sync --synctomaster --execute h=localhost,u=root,p=pass,D=db1,t=table1

2)My second question is about replication in general. Again I will suppose that server1 rebooted.

If I do (on server1)

show slave status;

I will get a "Read_Master_Log_Pos:" that does not match the output of "Position" :

(on server 2)
show master status;


Will the replication still work??? I mean, is it necessary to do stop slave, reset master, reset slave, start slave on both to restart the replication?

Any help would be greatly appreciated

Marc
Reply With Quote
Sponsored Links
  #2  
Old 20th September 2008, 13:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Quote:
Originally Posted by marchost View Post
1)If server1 reboot, will it resync automatically with server2 upon restart?
Yes, provided that the server's downtime is < expire_logs_days. If not, then there are no logs so that the server doesn't know what to replicate.


Quote:
Originally Posted by marchost View Post
2)My second question is about replication in general. Again I will suppose that server1 rebooted.

If I do (on server1)

show slave status;

I will get a "Read_Master_Log_Pos:" that does not match the output of "Position" :

(on server 2)
show master status;


Will the replication still work???
What is important is that Slave_IO_Running and Slave_SQL_Running both show Yes.
The servers might not always be 100% in sync - depending on network load or server load it can take a few seconds until a server catches up.

If you need to repair replication, this tutorial might be interesting: http://www.howtoforge.com/how-to-rep...ql-replication
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
marchost (23rd October 2008)
  #3  
Old 22nd September 2008, 07:10
marchost marchost is offline
Junior Member
 
Join Date: Feb 2008
Posts: 27
Thanks: 1
Thanked 4 Times in 4 Posts
Default Great...

Thanks for your answer Falko...

I successfully build a load balanced + high availability server (currently in production) on 2 real servers running Xen (instead of having 4 servers...) with http, mysql, mail and dns based on many of your howtos...

Im almost done writing an howto about it, will post it on howtoforge when it will be completed but you can take a peak :

http://blogama.org/?q=node/21

Marc
Reply With Quote
The Following User Says Thank You to marchost For This Useful Post:
falko (23rd September 2008)
  #4  
Old 23rd September 2008, 20:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Looks great! I'd love to see it on HowtoForge.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 3rd October 2008, 19:04
marchost marchost is offline
Junior Member
 
Join Date: Feb 2008
Posts: 27
Thanks: 1
Thanked 4 Times in 4 Posts
Default Done...

Just put up the howto on howtoforge last night (took me 3-4h formatting the tutorial from my website )...

Soon will start working on a better version with shared high availability NFS for mail & web files instead of rsync, more user friendly interface (DNS, mail config, etc) and vmware.

Its totally unrelated but i benchmarked the xen kernel with unixbench on 3 computers and I always get 50% of the score compared with the standard kernel. Do you think vmware would give better performance? Maybe unixbench is not a good real life benchmark?

Marc
Reply With Quote
  #6  
Old 4th October 2008, 13:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
 
Default

Quote:
Originally Posted by marchost View Post
Just put up the howto on howtoforge last night (took me 3-4h formatting the tutorial from my website )...
Thanks a lot, will publish it soon!

Quote:
Originally Posted by marchost View Post
Its totally unrelated but i benchmarked the xen kernel with unixbench on 3 computers and I always get 50% of the score compared with the standard kernel. Do you think vmware would give better performance? Maybe unixbench is not a good real life benchmark?
Maybe with VMware ESX, but not with VMware Server. You might also want to try OpenVZ.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems and Questions Krrose27 Installation/Configuration 10 15th November 2007 12:37
Mysql Master Master replication stormrider HOWTO-Related Questions 5 16th February 2007 18:18
Multiple ISPConfig & DNS Questions and Problems bfriend Installation/Configuration 3 6th January 2007 06:14
Users and websites aren't created Glorfindel Installation/Configuration 9 23rd February 2006 04:20


All times are GMT +2. The time now is 11:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.