0

I have been trying to disable binary logging on a slave server, since I do not use it as a master for another one, I have no use for the logs and I am trying to reduce lag so cut out everything that might be unnecessary.

Here's my my.cnf for the slave:


[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

[mysqld_safe]
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /srv/mysql
tmpdir      = /tmp
lc-messages-dir = /usr/share/mysql
explicit_defaults_for_timestamp

bind-address    = xxxxxxxxxxx

key_buffer      = 64M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 16
myisam-recover         = BACKUP
table_open_cache                = 512

query_cache_limit   = 1M
query_cache_size        = 256M

slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 10
max_binlog_size         = 100M    # this
expire_logs_days    = 10     # this

log-error   = /var/log/mysql/error.log

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

symbolic-links=0

innodb_file_per_table
innodb_additional_mem_pool_size = 20M
innodb_buffer_pool_size     = 24G
innodb_file_format      = "Barracuda"

binlog-format=MIXED     # this
log-slave-updates=true   # this
log-bin        # this
server-id=2
gtid-mode=on
enforce-gtid-consistency=true

[mysqldump]
quick
quote-names
max_allowed_packet  = 32M

[isamchk]
key_buffer      = 16M

!includedir /etc/mysql/conf.d/

So I have tried to remove the lines I marked with "#this", and if I do the server no longer starts up, just hangs on start

Is there anything else I need to remove? or put in in place of this to make it work?

Thanks

  • Check the /var/log/mysql/error.log to see what it says when you try to start it. – jkavalik Oct 9 '15 at 13:09
  • ah sorry forgot to include that, I have, and this was the only thing: [ERROR] --gtid-mode=ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updates, which I cant find too much about, but does this mean I cannot disable that? because I am trying to follow this: dba.stackexchange.com/questions/87487/… that suggests that this should be possible (suggestion #5) – user77522 Oct 9 '15 at 13:18
  • You should add that directly to the question.. I found dev.mysql.com/doc/refman/5.6/en/replication-gtids-howto.html which mentions log-save-updates as required and dev.mysql.com/doc/refman/5.7/en/… mentions it is required prior 5.7.5 – jkavalik Oct 9 '15 at 13:41
  • @user77522 the post you cited was never accepted as an answer, so we don't know whether it worked. In 5.6, GTID mode is optional. Without it enabled, this should work, but not with it enabled. And don't think about disabling it as a workaround. Enable multi-threaded replication, instead, which almost requires GTIDs: dev.mysql.com/tech-resources/articles/… (It doesn't technically require them, but it's much more straightforward). – Michael - sqlbot Oct 12 '15 at 0:20

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.