Skip to content

Commit 4b2a9ad

Browse files
committed
Added wsrep auth
1 parent 2a342a4 commit 4b2a9ad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

charts/galera/templates/statefulset-galera-cluster.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,19 @@ spec:
3939
value: {{ .Values.galera.domainId | quote }}
4040
- name: AUTO_INCREMENT_OFFSET
4141
value: {{ .Values.galera.autoIncrementOffset | quote }}
42-
command: ['sh', '-c', 'ordinal=`hostname | sed -r "s/([^0-9]*([0-9]*)){1}.*/\2/"`; chmod -R 777 /var/lib/mysql; if [ $ordinal = 0 ]; then touch /var/lib/mysql/new-cluster; fi; echo "[Service]" > /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf; echo "TimeoutStartSec=30min" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf; echo "TimeoutStopSec=30min" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf; echo "LimitNOFILE=65535" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf; echo [mariadb] > /mnt/conf.d/server-id.cnf; echo server_id=${DOMAIN_ID:-100} >> /mnt/conf.d/server-id.cnf; echo wsrep_gtid_domain_id=${DOMAIN_ID:-100} >> /mnt/conf.d/server-id.cnf; echo gtid_domain_id=100${DOMAIN_ID:-100}${ordinal} >> /mnt/conf.d/server-id.cnf; echo auto_increment_offset=$((${AUTO_INCREMENT_OFFSET:-0} + $ordinal)) >> /mnt/conf.d/server-id.cnf; cp /mnt/configmap/* /mnt/conf.d;']
42+
command: ['sh', '-c', 'ordinal=`hostname | sed -r "s/([^0-9]*([0-9]*)){1}.*/\2/"`;
43+
chmod -R 777 /var/lib/mysql; if [ $ordinal = 0 ]; then touch /var/lib/mysql/new-cluster; fi;
44+
echo "[Service]" > /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf;
45+
echo "TimeoutStartSec=30min" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf;
46+
echo "TimeoutStopSec=30min" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf;
47+
echo "LimitNOFILE=65535" >> /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf;
48+
echo [mariadb] > /mnt/conf.d/server-id.cnf;
49+
echo server_id=${DOMAIN_ID:-100} >> /mnt/conf.d/server-id.cnf;
50+
echo wsrep_gtid_domain_id=${DOMAIN_ID:-100} >> /mnt/conf.d/server-id.cnf;
51+
echo gtid_domain_id=100${DOMAIN_ID:-100}${ordinal} >> /mnt/conf.d/server-id.cnf;
52+
echo auto_increment_offset=$((${AUTO_INCREMENT_OFFSET:-0} + $ordinal)) >> /mnt/conf.d/server-id.cnf;
53+
echo wsrep_sst_auth=backupuser:MariaDB_123 >> /mnt/conf.d/server-id.cnf;
54+
cp /mnt/configmap/* /mnt/conf.d;']
4355
volumeMounts:
4456
- name: conf
4557
mountPath: /mnt/conf.d

charts/galera/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ mariadbConfiguration: |-
168168
skip-name-resolve
169169
skip-slave-start
170170
wait_timeout=60
171-
wsrep_auto_increment_control=0
171+
wsrep_auto_increment_control=OFF
172172
wsrep_gtid_mode=ON
173173
wsrep_notify_cmd=/usr/local/bin/notify.sh
174174
wsrep_provider_options="gcache.size=1024M; gcache.keep_pages_size=1024M; gcache.recover=yes; gcs.fc_factor=0.8;"

0 commit comments

Comments
 (0)