@@ -112,6 +112,9 @@ if [ -z "$whitelist" ]; then
112112 fi
113113fi
114114
115+ innodb_buffer_pool_size=" $INNODB_BUFFER_POOL_SIZE "
116+ group_replication_message_cache_size=" $GROUP_REPLICATION_MESSAGE_CACHE_SIZE "
117+
115118# the mysqld configurations have take by following
116119# 01. official doc: https://dev.mysql.com/doc/refman/5.7/en/group-replication-configuring-instances.html
117120# 02. digitalocean doc: https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-ubuntu-16-04
@@ -133,11 +136,16 @@ log_bin = binlog
133136loose-group_replication_bootstrap_group = OFF
134137loose-group_replication_start_on_boot = OFF
135138
139+
136140# default tls configuration for the group
137141# group_replication_recovery_use_ssl will be overwritten from DB arguments
138142loose-group_replication_ssl_mode = REQUIRED
139143loose-group_replication_recovery_use_ssl = 1
140144
145+ # recommended config
146+ innodb_buffer_pool_size = "${innodb_buffer_pool_size} "
147+ loose-group-replication-message-cache-size = "${group_replication_message_cache_size} "
148+
141149# Shared replication group configuration
142150loose-group_replication_group_name = "${GROUP_NAME} "
143151#loose-group_replication_ip_whitelist = "${hosts} "
@@ -179,6 +187,10 @@ loose-group_replication_start_on_boot = OFF
179187loose-group_replication_ssl_mode = REQUIRED
180188loose-group_replication_recovery_use_ssl = 1
181189
190+ # recommended config
191+ innodb_buffer_pool_size = "${innodb_buffer_pool_size} "
192+ loose-group-replication-message-cache-size = "${group_replication_message_cache_size} "
193+
182194# Shared replication group configuration
183195loose-group_replication_group_name = "${GROUP_NAME} "
184196#loose-group_replication_ip_whitelist = "${hosts} "
@@ -204,6 +216,14 @@ socket="/var/run/mysqld/mysqld.sock"
204216EOL
205217fi
206218
219+ # recommended config
220+ if [ -v BINLOG_EXPIRE_LOGS_SECONDS ]; then
221+ cat >> /etc/mysql/group-replication.conf.d/group.cnf << EOL
222+ binlog_expire_logs_seconds = "$BINLOG_EXPIRE_LOGS_SECONDS "
223+ EOL
224+ fi
225+
226+
207227# wait for mysql daemon be running (alive)
208228function wait_for_mysqld_running() {
209229 local mysql=" $mysql_header --host=$localhost "
0 commit comments