#1  
Old 28th July 2006, 11:32
Jamesk5 Jamesk5 is offline
Junior Member
 
Join Date: Apr 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default mysql replication issues

I've got replication working on two machines, both running Debian (etch) and the latest version of mySQL-server-5.0, but I've got an issue with the slave.
If the machine goes down, the slave 'feature' of mysql doesn't seem to automatically turn its self on - not sure why. I've followed the mySQL docs on replication.
Also, when I run the 'start slave' command on the slave, it doesn't go and automatically carry out any changes that have been done on the master since the slave went down.

Any suggestions will be appreciated,
James
Reply With Quote
Sponsored Links
  #2  
Old 29th July 2006, 12:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

Did you take a look at this tutorial? http://www.howtoforge.com/mysql_database_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
  #3  
Old 29th July 2006, 17:45
Jamesk5 Jamesk5 is offline
Junior Member
 
Join Date: Apr 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes I did, but in your tutorial you only cover how to replicate a single database, where as I need the whole MySQL DB replicated for data redundancy and a hotswap incase my main machine goes down.
Your tutorial barely differs from the docs on the MySQL site - which is why I posted the question.
Thanks for the how-to anyway, but I've basically used parts of your tute and the rest of the stuff from the mysql docs.
Reply With Quote
  #4  
Old 30th July 2006, 16:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

Quote:
Originally Posted by Jamesk5
where as I need the whole MySQL DB replicated for data redundancy and a hotswap incase my main machine goes down.
Basically you must list all databases in my.cnf on the master and slave.

Master:

Code:
binlog-do-db=db1
binlog-do-db=db2
binlog-do-db=db3
binlog-do-db=db4
binlog-do-db=db5
binlog-do-db=db6
binlog-do-db=db7
...
Slave:

Code:
replicate-do-db=db1
replicate-do-db=db2
replicate-do-db=db3
replicate-do-db=db4
replicate-do-db=db5
replicate-do-db=db6
replicate-do-db=db7
...
__________________
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:
feeninuoumn (16th January 2014)
  #5  
Old 2nd August 2006, 02:49
Jamesk5 Jamesk5 is offline
Junior Member
 
Join Date: Apr 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ahhh ok, so every time I add a DB to the master I need to add it to the list in both my.cnf files. It just seems a bit silly too me - considering that it works to some degree without all the lines that you mentioned above.
Reply With Quote
  #6  
Old 3rd August 2006, 14:56
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

Yes, maybe a little bit silly, but it's working.
__________________
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 22nd August 2006, 16:15
Jamesk5 Jamesk5 is offline
Junior Member
 
Join Date: Apr 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Falko, I'll give it a try. It really does seem silly to have to add each new DB I create - but if it works I can't really complain!!

I've got automated sql dumps being forwarded out to a secondary machine anyway, so perhaps that would be better than worrying about replication issues.
From what I can see, replication is a great way of having 'real time' backups, but mysqldump seems to be more reliable as a way of backing up all the data in a DB without having to worry about specifying tables etc.
Reply With Quote
  #8  
Old 22nd September 2006, 05:20
lifeisboost lifeisboost is offline
Senior Member
 
Join Date: Feb 2006
Posts: 122
Thanks: 0
Thanked 2 Times in 2 Posts
Default

sorry to bring an old thread back BUT im trying to replicate 7 DB's i tried entering each DB into my.cnf but when i go to show master it shows all the dbs being logged into one bin log is this correct?

+------------------+----------+-------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+-------------------+------------------+
| mysql-bin.000002 | 1125758 | web1_db1,web1_db2 | |
+------------------+----------+-------------------+------------------+

should there not be a binlog for EACH db? or does each position make up for it being different db's? also i see everytime you restart mysql it creates another log file. if i tell the slave to watch mysql-bin.000002 and the master gets rebooted it will rotate to log mysql-bin.000003, would i then have to set everything back up on the slave?

Last edited by lifeisboost; 22nd September 2006 at 18:36.
Reply With Quote
  #9  
Old 23rd September 2006, 14:40
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
 
Default

Quote:
Originally Posted by lifeisboost
when i go to show master it shows all the dbs being logged into one bin log is this correct?
Yes, that's correct.

Quote:
Originally Posted by lifeisboost
if i tell the slave to watch mysql-bin.000002 and the master gets rebooted it will rotate to log mysql-bin.000003, would i then have to set everything back up on the slave?
No, all changes should be replicated to the slave.
__________________
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
how to make php to work with mysql (php installed with apt-get, (no mysql support) grafik Installation/Configuration 3 15th May 2006 23:18
Mysql Replication alienation HOWTO-Related Questions 1 16th January 2006 08:34
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04
Problem installing ISPConfig, then with MySQL... ctroyp Installation/Configuration 7 26th September 2005 16:37
MySQL issue during install of ISPConfig ricbax Installation/Configuration 4 16th September 2005 09:41


All times are GMT +2. The time now is 20:38.


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