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 1st July 2010, 12:34
black_magik black_magik is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL Database Replication Problem

I've read the article of Falko Timme at:

http://www.howtoforge.com/mysql_database_replication

and i've follow all the instruction to make a MySQL replication between
two servers, one with Centos 5.5, MySQL 5.0.77 and one with Gentoo Base
System release 1.12.13 and MySQL 5.0.84
i want to replicate 5 different databases and i've added them in my.cnf
in this way on the master:

log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=database1
binlog-do-db=database2
binlog-do-db=database3
binlog-do-db=database4
binlog-do-db=database5
server-id=1

and on the slave:

server-id=2
master-host=XXX.XXX.XXX.XXX (the master address)
master-user=slave_user
master-password=pwd
master-connect-retry=60
replicate-do-db=database1
replicate-do-db=database2
replicate-do-db=database3
replicate-do-db=database4
replicate-do-db=database4

for the rest i've follow step-by-step all the instruction on the guide
and i didn't receive any error.
But doesn't work anything!!!!

The db doesn't replicate

Can you help me please

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 1st July 2010, 15:37
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

on the slave:

Code:
slave start
?

what's the output of
Code:
show slave status
Reply With Quote
  #3  
Old 1st July 2010, 15:56
black_magik black_magik is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i've already do the slave start, but nothing it do; if i do:

show slave status this is the answer:

+----------------+--------------+-------------+-------------+---------------+------------------+---------------------+-------------------------+---------------+-----------------------+------------------+-------------------+-------------------------------------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+
| Slave_IO_State | Master_Host | Master_User | Master_Port | Connect_Retry | Master_Log_File | Read_Master_Log_Pos | Relay_Log_File | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignore_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seconds_Behind_Master |
+----------------+--------------+-------------+-------------+---------------+------------------+---------------------+-------------------------+---------------+-----------------------+------------------+-------------------+-------------------------------------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+
| | 192.168.3.16 | slave_user | 3306 | 60 | mysql-bin.000010 | 98 | mysqld-relay-bin.000001 | 98 | mysql-bin.000010 | No | Yes | website,eucilia,euclyd,aaveye,cardiogenet | | | | | | 0 | | 0 | 98 | 98 | None | | 0 | No | | | | | | NULL |
+----------------+--------------+-------------+-------------+---------------+------------------+---------------------+-------------------------+---------------+-----------------------+------------------+-------------------+-------------------------------------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+
1 row in set (0.00 sec)
Reply With Quote
  #4  
Old 1st July 2010, 16:37
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

Well the replication is not running, check both servers mysql error log files for errors.

mostly they're called hostname.err
Reply With Quote
  #5  
Old 1st July 2010, 17:53
black_magik black_magik is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And WHERE is located this file ???
in /var/log/mysql
because if it is located there is not present
Reply With Quote
  #6  
Old 2nd July 2010, 11:41
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Please check /var/log/syslog and/or /var/log/messages for MySQL errors.
__________________
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 2nd July 2010, 11:54
black_magik black_magik is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the /var/log/messages (both maste and slave) i didn't find anything about mysql but if i do the command:

tail -f /var/log/mysql/mysqd.err on the slave i receive:

100623 14:01:34 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
100623 14:01:34 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000008', position 98
100623 14:02:10 [Note] Error reading relay log event: slave SQL thread was killed
100623 14:04:09 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000010' at position 98, relay log './mysqld-relay-bin.000001' position: 4
100623 14:04:09 [Note] Slave I/O thread: connected to master 'slave_user@192.168.3.16:3306', replication started in log 'mysql-bin.000010' at position 98
100623 14:04:09 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
100623 14:04:09 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000010', position 98
100701 12:22:44 [Note] Slave I/O thread: connected to master 'slave_user@192.168.3.16:3306', replication started in log 'mysql-bin.000010' at position 98
100701 12:22:44 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
100701 12:22:44 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000010', position 98

i didn't understand wich id is equal, because i've set:
server-id=1 on the master and:
server-id=2 on the slave (as you see in the previous post)
Reply With Quote
  #8  
Old 3rd July 2010, 11:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Did you restart MySQL on both nodes?
__________________
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
  #9  
Old 4th July 2010, 19:20
black_magik black_magik is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, of course
Reply With Quote
  #10  
Old 5th July 2010, 17:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
 
Default

Do you have more than one slave server?

Did you try a reboot?
__________________
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
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail -Ubuntu 8.04 c4rdinal HOWTO-Related Questions 112 23rd August 2011 10:49
Mysql replication problem lano Server Operation 6 1st February 2010 18:56
BIG Problem Postfix issue admins Installation/Configuration 11 13th November 2009 10:05
phpmyadmin error lifeisboost Installation/Configuration 9 14th August 2008 19:19
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04


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


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