0

I am trying to configure master-master replication however I am getting an error. I am sending my configuration below

Server A

server-id = 1
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 1

master-host = Kooler-PC
master-user = replicacao
master-password = replicacao
master-connect-retry = 60
replicate-do-db = gestao_quadra

log-bin = C:\mysql\log\log-bin.log
binlog-do-db = gestao_quadra

CHANGE MASTER TO MASTER_HOST='Kooler-PC', MASTER_USER='replicacao', MASTER_PASSWORD='replicacao', MASTER_LOG_FILE='log-bin.log ', MASTER_LOG_POS=0;

I am have done the same steps for other server changing server-id, host and created the file in the path.

I get this error:

130218 18:03:02 [Note] Slave I/O thread: connected to master 'replicacao@Kooler-PC:3306',replication started in log 'log-bin.log ' at position 4
130218 18:03:02 [ERROR] Error reading packet from server: Binary log is not open ( server_errno=1236)
130218 18:03:02 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Binary log is not open', Error_code: 1236
130218 18:03:02 [Note] Slave I/O thread exiting, read up to log 'log-bin.log ', position 4

I am using MySQL 5.5

4

1 回答 1

2

因此,如果您阅读有关复制二进制日志记录的 mysql 手册,它会告诉您这一行:

log-bin = C:\mysql\log\log-bin.log

不创建具有该名称的日志文件。它指定基本名称。实际创建的日志文件将命名为:

C:\mysql\log\log-bin.log.000001

也就是说,实际的日志在您指定的名称末尾附加了一个序列号。要查看实际的日志名称,请使用以下命令:

SHOW MASTER STATUS
SHOW BINARY LOGS;

您的变更主声明的这一部分无效:

MASTER_LOG_FILE='log-bin.log ', MASTER_LOG_POS=0;

我读过的任何与复制相关的说明都不会导致您使用位置 0。您必须使用主服务器的二进制日志文件和与您初始化从服务器的数据快照相对应的位置。

有关更多信息,请参阅手册。在尝试更复杂的复制结构之前,首先从基本的主->从复制开始。 http://dev.mysql.com/doc/refman/5.5/en/replication.html

于 2013-02-18T23:25:57.643 回答