From 34367309a45ad19dcb19b07e59ad8d2a7a0ca67a Mon Sep 17 00:00:00 2001 From: SK Ali Arman Date: Wed, 16 Apr 2025 15:47:23 +0600 Subject: [PATCH 1/3] Set inddodb-beffer-pool-size Signed-off-by: SK Ali Arman --- scripts/run.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/run.sh b/scripts/run.sh index 3a7b9b8..de77afa 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -112,6 +112,9 @@ if [ -z "$whitelist" ]; then fi fi +innodb_buffer_pool_size="$INNODB_BUFFER_POOL_SIZE" +group_replication_message_cache_size="$GROUP_REPLICATION_MESSAGE_CACHE_SIZE" + # the mysqld configurations have take by following # 01. official doc: https://dev.mysql.com/doc/refman/5.7/en/group-replication-configuring-instances.html # 02. digitalocean doc: https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-ubuntu-16-04 @@ -138,6 +141,10 @@ loose-group_replication_start_on_boot = OFF loose-group_replication_ssl_mode = REQUIRED loose-group_replication_recovery_use_ssl = 1 +# recommened config +innodb_buffer_pool_size = "${innodb_buffer_pool_size}" +loose-group-replication-message-cache-size = "${group_replication_message_cache_size}" + # Shared replication group configuration loose-group_replication_group_name = "${GROUP_NAME}" #loose-group_replication_ip_whitelist = "${hosts}" @@ -179,6 +186,10 @@ loose-group_replication_start_on_boot = OFF loose-group_replication_ssl_mode = REQUIRED loose-group_replication_recovery_use_ssl = 1 +# recommened config +innodb_buffer_pool_size = "${innodb_buffer_pool_size}" +loose-group-replication-message-cache-size = "${group_replication_message_cache_size}" + # Shared replication group configuration loose-group_replication_group_name = "${GROUP_NAME}" #loose-group_replication_ip_whitelist = "${hosts}" @@ -204,6 +215,14 @@ socket="/var/run/mysqld/mysqld.sock" EOL fi +# recommended config +if [ -v BINLOG_EXPIRE_LOGS_SECONDS ]; then + cat >>/etc/mysql/group-replication.conf.d/group.cnf < Date: Tue, 22 Apr 2025 11:12:05 +0600 Subject: [PATCH 2/3] resolve comments Signed-off-by: SK Ali Arman --- scripts/run.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index de77afa..466f3ac 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -112,9 +112,6 @@ if [ -z "$whitelist" ]; then fi fi -innodb_buffer_pool_size="$INNODB_BUFFER_POOL_SIZE" -group_replication_message_cache_size="$GROUP_REPLICATION_MESSAGE_CACHE_SIZE" - # the mysqld configurations have take by following # 01. official doc: https://dev.mysql.com/doc/refman/5.7/en/group-replication-configuring-instances.html # 02. digitalocean doc: https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-ubuntu-16-04 @@ -142,8 +139,9 @@ loose-group_replication_ssl_mode = REQUIRED loose-group_replication_recovery_use_ssl = 1 # recommened config -innodb_buffer_pool_size = "${innodb_buffer_pool_size}" -loose-group-replication-message-cache-size = "${group_replication_message_cache_size}" +innodb_buffer_pool_size = "$INNODB_BUFFER_POOL_SIZE" +loose-group-replication-message-cache-size = "$GROUP_REPLICATION_MESSAGE_CACHE_SIZE" +binlog_expire_logs_seconds = "$BINLOG_EXPIRE_LOGS_SECONDS" # Shared replication group configuration loose-group_replication_group_name = "${GROUP_NAME}" @@ -187,8 +185,9 @@ loose-group_replication_ssl_mode = REQUIRED loose-group_replication_recovery_use_ssl = 1 # recommened config -innodb_buffer_pool_size = "${innodb_buffer_pool_size}" -loose-group-replication-message-cache-size = "${group_replication_message_cache_size}" +innodb_buffer_pool_size = "$INNODB_BUFFER_POOL_SIZE" +loose-group-replication-message-cache-size = "$GROUP_REPLICATION_MESSAGE_CACHE_SIZE" +binlog_expire_logs_seconds = "$BINLOG_EXPIRE_LOGS_SECONDS" # Shared replication group configuration loose-group_replication_group_name = "${GROUP_NAME}" @@ -215,14 +214,6 @@ socket="/var/run/mysqld/mysqld.sock" EOL fi -# recommended config -if [ -v BINLOG_EXPIRE_LOGS_SECONDS ]; then - cat >>/etc/mysql/group-replication.conf.d/group.cnf < Date: Wed, 23 Apr 2025 12:36:24 +0600 Subject: [PATCH 3/3] refactor multi-primary Signed-off-by: SK Ali Arman --- scripts/run.sh | 51 +++----------------------------------------------- 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 466f3ac..556cb24 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -120,7 +120,6 @@ mkdir -p /etc/mysql/group-replication.conf.d/ echo "!includedir /etc/mysql/group-replication.conf.d/" >>/etc/mysql/my.cnf mkdir -p /etc/mysql/conf.d/ echo "!includedir /etc/mysql/conf.d/" >>/etc/mysql/my.cnf -if [[ "$PRIMARY_TYPE" == "Multi-Primary" ]]; then cat >>/etc/mysql/group-replication.conf.d/group.cnf <>/etc/mysql/group-replication.conf.d/group.cnf <