Linux technical support - support@alexlinux.com


mysql master master my.cnf example

Master1

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

binlog-ignore-db = information_schema
binlog-ignore-db = mysql
binlog-ignore-db = performance_schema
binlog-ignore-db = test
innodb_file_per_table
server-id = 1
binlog_format = ROW
expire_logs_days=3
log_bin = /var/log/mariadb/mysql-bin.log
relay_log = /var/lib/mariadb/relay-bin.log
auto_increment_increment = 2
auto_increment_offset    = 1

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d

Master2

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

binlog-ignore-db = information_schema
binlog-ignore-db = mysql
binlog-ignore-db = performance_schema
binlog-ignore-db = test
innodb_file_per_table
server-id = 2
binlog_format = ROW
expire_logs_days=3
log_bin = /var/log/mariadb/mysql-bin.log
relay_log = /var/lib/mariadb/relay-bin.log
auto_increment_increment = 2
auto_increment_offset    = 2

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>