Bug #76341 Replication with GTID (no binlog) fails - 'Binary log is not open'

Submitted: 16 Mar 2015 17:10 Modified: 22 Aug 2018 17:21
Reporter: eva zangerle Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.7.6 OS:Linux (3.10.0-123.9.3.el7.x86_64)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: binglog, replication

[16 Mar 2015 17:10] eva zangerle
Description:
When setting up master-slave replication on 5.7.6 servers with GTID-based replication (and bin-log deactivated), the slave fails to replicate data from the master. Using SHOW SLAVE STATUS reveals the following error: "Got fatal error 1236 from master when reading data from binary log: 'Binary log is not open'" - however, I intentionally did not activate the binlog due to GTID-functionality since 5.7.5 and hence, obviously not binlog can be found on the server.

Checking the mysql.gtid_executed table on the master, no transactions are added at all when performing queries and updates on the master server. However, as soon as I enable the binlog on the master and restart it, the mysql.gtid_executed table gets filled and replication works. 

How to repeat:
Use MySQL 5.7.6 on master and slave; 

Add the following lines to my.cnf on master-node:
server-id=255
gtid-mode=ON
enforce-gtid-consistency

Add the following lines to my.cnf on slave-node:
server-id=2
gtid-mode=ON
enforce-gtid-consistency
skip-slave-start

create a user-account for the slave server and grant replication slave permission to slave by the following command:
CREATE USER 'replikation'@'192.168.71.%' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'replikation'@'192.168.71.%';

On slave node, perform change master command as follows:
CHANGE MASTER TO 
MASTER_HOST = '192.168.71.38',
MASTER_USER = 'replikation',
MASTER_PASSWORD = 'password',
MASTER_AUTO_POSITION = 1;

and finally start the slave:
START SLAVE;
SHOW SLAVE STATUS;
[22 Aug 2018 17:21] MySQL Verification Team
Hi, this is not a bug.
You must have binlog enabled on master in order for replication to work!

https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-howto.html

It is not mandatory to have binary logging enabled in order to use GTIDs when using the mysql.gtid_executed Table. *Masters must always have binary logging enabled in order to be able to replicate.* However, slave servers can use GTIDs but without binary logging. If you need to disable binary logging on a slave server, you can do this by specifying the --skip-log-bin and --skip-log-slave-updates options for the slave. 

kind regards
Bogdan

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.