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 master master replication not working (http://www.howtoforge.com/forums/showthread.php?t=11169)

SoftDux 6th March 2007 21:15

mysql master master replication not working
 
Hi

Can someone please help me?

I have followed the mysql master-master replication howto, but it doesn't seem to work.

if I run the command "slave start;" I get the following error:

Code:

ERROR 1200 (HY000): The server is not configured as slave; fix in config file or
 with CHANGE MASTER TO
Empty set (0.00 sec)

Can someone please tell me where / how to set the slave?

falko 7th March 2007 19:12

What's in the my.cnf file of the slave?

1soproni 27th March 2007 19:10

My problem is the same as SoftDux's.
mysql-5.0.37
Step10:
Quote:

mysql> start slave;
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO
mysql>
Master1/Slave2:

[client]
port = 3307
socket = /tmp/mysql.sock

[mysqld]
port = 3307
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin

binlog_do_db=valami
binlog_ignore_db=mysql
binlog_ignore_db=test
server-id = 1
master-host = 1.2.3.4
master-user = replication
master-password = slave2
master-port = 3307

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
------------------------------------------
Slave1/Master2:

[client]
port = 3307
socket = /tmp/mysql.sock

[mysqld]
port = 3307
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

log-bin=mysql-bin

binlog_do_db=valami
binlog_ignore_db=mysql
binlog_ignore_db=test

server-id = 2
master-host = 5.6.7.8
master-user = replication
master-password = slave
master-port = 3307

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


Master1/Slave2 log:
070327 17:11:21 [Warning] Neither --relay-log nor --relay-log-index were used; s
o replication may break when this MySQL server acts as a slave and has his hostn
ame changed!! Please use '--relay-log=www3-relay-bin' to avoid this problem.
070327 17:11:21 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.0.37-log' socket: '/tmp/mysql.sock' port: 3307 MySQL Community Se
rver (GPL)
070327 17:11:21 [Note] Slave SQL thread initialized, starting replication in log
'FIRST' at position 0, relay log './www3-relay-bin.000011' position: 98
070327 17:11:21 [Note] Slave I/O thread: connected to master 'test@:3307', repl
ication started in log 'FIRST' at position 4
070327 17:11:21 [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 a
lways make sense; please check the manual before using it).
070327 17:11:21 [Note] Slave I/O thread exiting, read up to log 'FIRST', positio
n 4

falko 28th March 2007 16:04

Quote:

Originally Posted by 1soproni
Master1/Slave2 log:
070327 17:11:21 [Warning] Neither --relay-log nor --relay-log-index were used; s
o replication may break when this MySQL server acts as a slave and has his hostn
ame changed!! Please use '--relay-log=www3-relay-bin' to avoid this problem.

Please try to add
Code:

relay-log = www3-relay-bin
to the my.cnf files and try again.

1soproni 28th March 2007 20:20

070328 18:19:39 [Note] Slave SQL thread initialized, starting replication in log
'FIRST' at position 0, relay log './www3-relay-bin.000013' position: 98
070328 18:19:39 [Note] Slave I/O thread: connected to master 'test@:3307', repl
ication started in log 'FIRST' at position 4
070328 18:19:39 [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 a
lways make sense; please check the manual before using it).
070328 18:19:39 [Note] Slave I/O thread exiting, read up to log 'FIRST', positio
n 4

"Show variables;" shows differents server-ids.

falko 29th March 2007 14:31

I found something interesting at the end of this page: http://atmail.com/view_article.php?num=580


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

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