MariaDB binary logging and master-master replication
I am trying to set up MariaDB master-master replication on a Debian server.
Server version: 10.3.25-MariaDB-0+deb10u1 Debian 10.
I have read many tutorials and all of them says it´s necessary to edit `my.cnf` file. Probably all the tutorials are outdated because `my.cnf` file on my server contains only 1 line:
Directory `/etc/mysql/conf.d/` also contains only 1 file mysq.cnf with 1 line:
I found that all settings are in: `/etc/mysql/mariadb.conf.d/50-server.cnf` file
So, I started to set up the first server and added the following lines to `50-server.cnf` file as described [here], [here] and in other tutorials:
bind-address = 127.0.0.1,SECOND_SERVER_IP_ADDRESS server-id = 1 log-bin auto_increment_increment = 5 auto_increment_offset = 1 replicate-ignore-db = mysql replicate-ignore-db = information_schema replicate-ignore-db = performance_schema
create user 'repli'@'%' identified by 'password'; grant replication slave on *.* to 'repli'@'%'; FLUSH PRIVILEGES;
show master status; MariaDB [(none)]> show master status; Empty set (0.000 sec)
show binary logs; ERROR 1381 (HY000): You are not using binary logging
I tried different settings to enable binary logging:
log-bin=mysql-bin log_bin= /var/log/mysql/mariadb-bin log_bin=/var/log/mysql/log.bin
`/var/log/mysql` directory of course exists:
drwxr-s--- 2 mysql adm 4096 Oct 30 10:19 mysql
I restart MariaDB, but none of the settings give any effect - I am still getting messaage "You are not using binary logging".
What I am doing wrong?
Answer Answered by Daniel Black in this comment.
note bind-address is only a single address which might be the cause. There's no need for 'FLUSH PRIVILEGES'. There's no need for replication filters on information_schema or performance schema, they aren't replicated anyway.
Caution about using /var/log/mysql as some logrotate rules may hit the binary log which can be problematic.
Did you following https://mariadb.com/kb/en/setting-up-replication/ though to see if you missed anything?
Is there anything in the error-log?