HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   MySQL Database Replication Problem (http://www.howtoforge.com/forums/showthread.php?t=46923)

black_magik 1st July 2010 12:34

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

Mark_NL 1st July 2010 15:37

on the slave:

Code:

slave start
?

what's the output of
Code:

show slave status

black_magik 1st July 2010 15:56

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)

Mark_NL 1st July 2010 16:37

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

mostly they're called hostname.err

black_magik 1st July 2010 17:53

And WHERE is located this file ???
in /var/log/mysql
because if it is located there is not present

falko 2nd July 2010 11:41

Please check /var/log/syslog and/or /var/log/messages for MySQL errors.

black_magik 2nd July 2010 11:54

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)

falko 3rd July 2010 11:52

Did you restart MySQL on both nodes?

black_magik 4th July 2010 19:20

Yes, of course

falko 5th July 2010 17:58

Do you have more than one slave server?

Did you try a reboot?


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

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