Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ #45 | fix mysqlha backup with xtrabackup 8 #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions charts/mysqlha/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ data:
server-id=@@SERVER_ID@@
create-replication-user.sh: |-
#!/bin/bash

mysql -h 127.0.0.1 --verbose -e "CREATE USER IF NOT EXISTS '${MYSQL_REPLICATION_USER}' IDENTIFIED BY '${MYSQL_REPLICATION_PASSWORD}';"
retVal=$?
if [ $retVal -ne 0 ]; then
echo "error reported above so we need to retry..."
mysql -h 127.0.0.1 --verbose -e "GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '${MYSQL_REPLICATION_USER}' IDENTIFIED BY '${MYSQL_REPLICATION_PASSWORD}';"
else
mysql -h 127.0.0.1 --verbose -e "GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '${MYSQL_REPLICATION_USER}';"
mysql -h 127.0.0.1 --verbose -e "GRANT BACKUP_ADMIN, PROCESS, RELOAD, LOCK TABLES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '${MYSQL_REPLICATION_USER}';"
mysql -h 127.0.0.1 --verbose -e "GRANT SELECT ON performance_schema.log_status TO '${MYSQL_REPLICATION_USER}';"
mysql -h 127.0.0.1 --verbose -e "GRANT SELECT ON performance_schema.keyring_component_status TO '${MYSQL_REPLICATION_USER}';"
mysql -h 127.0.0.1 --verbose -e "GRANT SELECT ON performance_schema.replication_group_members TO '${MYSQL_REPLICATION_USER}';"
fi
mysql -h 127.0.0.1 --verbose -e "FLUSH PRIVILEGES;"
2 changes: 1 addition & 1 deletion charts/mysqlha/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ spec:

# Start a server to send backups when requested by peers.
exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c \
"xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=${MYSQL_REPLICATION_USER} --password=${MYSQL_REPLICATION_PASSWORD}"
"xtrabackup --backup --slave-info --safe-slave-backup --stream=xbstream --host=127.0.0.1 --user=${MYSQL_REPLICATION_USER} --password=${MYSQL_REPLICATION_PASSWORD}"
volumeMounts:
- name: data
mountPath: /var/lib/mysql
Expand Down
Loading