Skip to content

Instantly share code, notes, and snippets.

@kbarber
Created November 24, 2011 19:16
Show Gist options
  • Save kbarber/1392043 to your computer and use it in GitHub Desktop.
Save kbarber/1392043 to your computer and use it in GitHub Desktop.
mysql replication
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# KB
log-bin=mysql-bin
binlog-do-db=dashboard_production
binlog-ignore-db=mysql
binlog-ignore-db=test
server-id=1 # set to 2 for the secondary
character_set_server=utf8
slow_query_log
default_storage_engine=innodb
innodb_file_per_table
relay-log=mysqld-relay-bin
report-host=dashboard1.vm
innodb_flush_log_at_trx_commit=1
sync_binlog=1
# Fixes auto_increment allocation across 2 nodes
auto_increment_increment=2
auto_increment_offset=1 # set to 2 for the second node
master-host=dashboard2.vm
master-port=3306
master-user=repl
master-password=slavepass
master-connect-retry=60
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment