Skip to content

Commit 4800809

Browse files
committed
Set inddodb-beffer-pool-size
Signed-off-by: SK Ali Arman <[email protected]>
1 parent 7c61220 commit 4800809

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

scripts/run.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ if [ -z "$whitelist" ]; then
112112
fi
113113
fi
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
133136
loose-group_replication_bootstrap_group = OFF
134137
loose-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
138142
loose-group_replication_ssl_mode = REQUIRED
139143
loose-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
142150
loose-group_replication_group_name = "${GROUP_NAME}"
143151
#loose-group_replication_ip_whitelist = "${hosts}"
@@ -179,6 +187,10 @@ loose-group_replication_start_on_boot = OFF
179187
loose-group_replication_ssl_mode = REQUIRED
180188
loose-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
183195
loose-group_replication_group_name = "${GROUP_NAME}"
184196
#loose-group_replication_ip_whitelist = "${hosts}"
@@ -204,6 +216,14 @@ socket="/var/run/mysqld/mysqld.sock"
204216
EOL
205217
fi
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)
208228
function wait_for_mysqld_running() {
209229
local mysql="$mysql_header --host=$localhost"

0 commit comments

Comments
 (0)