Skip to content

Instantly share code, notes, and snippets.

@Yamakiroshi
Last active February 16, 2018 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yamakiroshi/bb39a8fb9d591b3297331e704da7c88a to your computer and use it in GitHub Desktop.
Save Yamakiroshi/bb39a8fb9d591b3297331e704da7c88a to your computer and use it in GitHub Desktop.
mysql Configuration for 5.7 Group Replication used for Replication scripts such as Terraform
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
# General replication settings
gtid_mode = ON
enforce_gtid_consistency = ON
master_info_repository = TABLE
relay_log_info_repository = TABLE
binlog_checksum = NONE
log_slave_updates = ON
log_bin = binlog
binlog_format = ROW
transaction_write_set_extraction = XXHASH64
loose-group_replication_bootstrap_group = OFF
loose-group_replication_start_on_boot = ON
loose-group_replication_ssl_mode = REQUIRED
loose-group_replication_recovery_use_ssl = 1
# Shared replication group configuration
loose-group_replication_group_name = "MYSQL_GROUP_UUID"
loose-group_replication_ip_whitelist = "MYSQL_SERVER_1,MYSQL_SERVER_2,MYSQL_SERVER_3"
loose-group_replication_group_seeds = "MYSQL_SERVER_1:33061,MYSQL_SERVER_2:33061,MYSQL_SERVER_3:33061"
# Single or Multi-primary mode? Uncomment these two lines
# for multi-primary mode, where any host can accept writes
loose-group_replication_single_primary_mode = OFF
loose-group_replication_enforce_update_everywhere_checks = ON
# Host specific replication configuration
server_id = MYSQL_SERVER_ID
bind-address = "MYSQL_PRIVATE_ADDRESS"
report_host = "MYSQL_PRIVATE_ADDRESS"
loose-group_replication_local_address = "MYSQL_PRIVATE_ADDRESS:33061"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment