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 14th April 2008, 18:57
ubutux ubutux is offline
Member
 
Join Date: Nov 2005
Location: Perth , Western Australia
Posts: 48
Thanks: 3
Thanked 1 Time in 1 Post
Default mysql master to master replication question

i have setup master to master replication on deb etch using the howto .It is working well with the single database i used for testing .now i would like to add the rest of the databases to this process .is there another way to add multiple db's or is best to add them one by one ? thanks
Reply With Quote
Sponsored Links
  #2  
Old 15th April 2008, 19:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

You must list the databases one by one in the my.cnf files, e.g.:
Code:
replicate-do-db = db1
replicate-do-db = db2
replicate-do-db = db3

binlog-do-db = db1
binlog-do-db = db2
binlog-do-db = db3
__________________
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
  #3  
Old 16th April 2008, 15:35
ubutux ubutux is offline
Member
 
Join Date: Nov 2005
Location: Perth , Western Australia
Posts: 48
Thanks: 3
Thanked 1 Time in 1 Post
Default

hi falko thanks again , once i add the other databases one by one to my.cnf will i need to follow the complete howto for each database ? ie: flush tables with read lock ,show master status etc i can follow the howto no problem ,i just dont fully understand this replicating process .thanks again
Reply With Quote
  #4  
Old 17th April 2008, 19:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

No, you need the read lock just once, and once you have that lock, you can create a dump for all databases that you want to replicate and then copy that dump to the other server.
__________________
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 18th April 2008, 03:13
ubutux ubutux is offline
Member
 
Join Date: Nov 2005
Location: Perth , Western Australia
Posts: 48
Thanks: 3
Thanked 1 Time in 1 Post
Default

thanks falko i will start to add the other databases locking and dumping one by one after this will add the lines for each db in my.cnf .

one other question i have is if one of the mysql servers is down for any period of time and the online server has been adding data to the database as per normal ,once server 2 comes online again will the replication be updated to server 1 current state ?.

Last edited by ubutux; 18th April 2008 at 03:16.
Reply With Quote
  #6  
Old 18th April 2008, 09:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

That depends on how long the server is down and what you set for expire_logs_days in my.cnf. If the server is down no longer than expire_logs_days, then it should resume automatically. But you should always check that by running
Code:
SHOW SLAVE STATUS;
__________________
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
  #7  
Old 12th March 2009, 11:48
EricTRA EricTRA is offline
Junior Member
 
Join Date: Feb 2009
Location: Terrassa, Barcelona, Spain
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to EricTRA
Default Removing replication on node

Hello Falko,

I have a question in the other direction of master master replication. I followed your howto, combined it with specific things we needed over here and everything is working just fine.

If I want to remove replication on a server is it enough to just remove the mentioning in the my.cnf file? I imagine not

In other words can you tell me what actions to perform to remove a host from replication scheme? Or point me to a HowTo?

Thanks a lot and keep up the good work.

Sincerely,

Eric
Reply With Quote
  #8  
Old 13th March 2009, 17:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Try this:
Code:
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='';
__________________
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
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
question about backing up two databases cruz Installation/Configuration 0 17th November 2007 20:50
mysql master master replication not working SoftDux HOWTO-Related Questions 5 29th March 2007 14:31
Mysql Master Master replication stormrider HOWTO-Related Questions 5 16th February 2007 18:18
mysql ha replication question flashingcurser HOWTO-Related Questions 5 8th November 2006 07:04


All times are GMT +2. The time now is 16:43.


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