Skip to content

Commit 226ac2c

Browse files
committed
Set InnoDB Buffer Pool Size
Signed-off-by: SK Ali Arman <[email protected]>
1 parent 20a0614 commit 226ac2c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

scripts/run.sh

Lines changed: 18 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
@@ -139,6 +142,10 @@ loose-group_replication_start_on_boot = OFF
139142
loose-group_replication_ssl_mode = REQUIRED
140143
loose-group_replication_recovery_use_ssl = 1
141144
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+
142149
# Shared replication group configuration
143150
loose-group_replication_group_name = "${GROUP_NAME}"
144151
#loose-group_replication_ip_whitelist = "${hosts}"
@@ -181,6 +188,10 @@ loose-group_replication_start_on_boot = OFF
181188
loose-group_replication_ssl_mode = REQUIRED
182189
loose-group_replication_recovery_use_ssl = 1
183190
191+
# recommended config
192+
innodb_buffer_pool_size = "${innodb_buffer_pool_size}"
193+
loose-group-replication-message-cache-size = "${group_replication_message_cache_size}"
194+
184195
# Shared replication group configuration
185196
loose-group_replication_group_name = "${GROUP_NAME}"
186197
#loose-group_replication_ip_whitelist = "${hosts}"
@@ -206,6 +217,13 @@ socket="/var/run/mysqld/mysqld.sock"
206217
EOL
207218
fi
208219

220+
# recommended config
221+
if [ -v BINLOG_EXPIRE_LOGS_SECONDS ]; then
222+
cat >>/etc/mysql/group-replication.conf.d/group.cnf <<EOL
223+
binlog_expire_logs_seconds = "$BINLOG_EXPIRE_LOGS_SECONDS"
224+
EOL
225+
fi
226+
209227
# wait for mysql daemon be running (alive)
210228
function wait_for_mysqld_running() {
211229
local mysql="$mysql_header --host=$localhost"

0 commit comments

Comments
 (0)