Skip to content

Instantly share code, notes, and snippets.

@lifuzu
Created September 25, 2013 17:17
Show Gist options
  • Save lifuzu/6702922 to your computer and use it in GitHub Desktop.
Save lifuzu/6702922 to your computer and use it in GitHub Desktop.
MYSQL replication configuration /etc/mysql/my.cfg
-bind-address = 127.0.0.1
+#bind-address = 127.0.0.1
#
# * Fine Tuning
#
@@ -55,7 +55,7 @@ thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
-#max_connections = 100
+max_connections = 4096
#table_cache = 64
#thread_concurrency = 10
#
@@ -84,12 +84,26 @@ log_error = /var/log/mysql/error.log
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
-#server-id = 1
-#log_bin = /var/log/mysql/mysql-bin.log
+server-id = 1
+log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
+binlog_do_db = <DATABASE_NAME>
+binlog_ignore_db = mysql
+
+replicate-same-server-id = 0
+log-slave-updates = 1
+#auto-increment-increment = 2
+#auto-increment-offset = 1
+rpl_semi_sync_slave_enabled = 1
+rpl_semi_sync_master_enabled = 1
+
+relay-log = /var/log/mysql/slave-relay.log
+relay-log-index = /var/log/mysql/slave-relay.index
+report-host = node-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment