[Linux-HA] MySQL MASTER/MASTER REPLICATION

Adrian Chapela achapela.rexistros at gmail.com
Wed Apr 2 09:19:55 MDT 2008


Néstor escribió:
> In my RHEL5, I am using this link to create MySQL replication an did work
> the first time I did it:
> http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/
>
> I change the ip address and the hostname and it is not working now.
> My new ip is 10.100.1.170 and my hostname is wahoo1.  The other ip
> address in my master/master replication is 10.100.1.171 and wahoo2
>
> *This is what wahoo1 my.cnf looks like*:
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> old_passwords=1
> auto_increment_increment=2
> auto_increment_offset=1
> relay-log=wahoo1-relay-bin
> log-bin=wahoo1-bin
> binlog-ignore-db=mysql
> binlog-ignore-db=test
> server-id = 1
> master-host = 10.100.1.171
> master-user = slaveuser
> master-password = slavepw
> master-port = 3306
>
> [mysql.server]
> user=mysql
> basedir=/var/lib
>
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
>
> *This is what wahoo2 my.cnf looks like:*
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> old_passwords=1
> auto_increment_increment=2
> auto_increment_offset=2
> relay-log=wahoo2-relay-bin
> log-bin=wahoo2-bin
> binlog-ignore-db=mysql
> binlog-ignore-db=test
> server-id = 2
> master-host = 10.100.1.170
> master-user = slaveuser
> master-password = slavepw
> master-port = 3306
>
> [mysql.server]
> user=mysql
> basedir=/var/lib
>
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
>
>
> *This is the error I get on my mysqld.log file*:
> 080401 15:15:07 [Note] Slave SQL thread initialized, starting replication in
> log 'FIRST' at position 0, relay log './wahoo2-relay-bin.000002' position:
> 98
> 080401 15:15:07 [ERROR] Slave I/O thread: error connecting to master '
> slaveuser at 10.100.1.170:3306': Error: 'Lost connection to MySQL server during
> query'  errno: 2013  retry-time: 60  retries: 86400
>   
This error is a mysql error, it isn't a Hearbeat error. You need to look 
at bind-addres, if you have this variable in config file the value must 
be an IP address which slave server can access. You must test if you can 
connect to the master server from the slave server (mysql -h master-host 
-P master_port -u user -p password). In master server you must look at 
user grants. Your slave user must have REPLICATION SLAVE grants.

Lucky!
>
> HELP!!!!!
>
> Thanks,
>
> Néstor :-)
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
>   



More information about the Linux-HA mailing list