Skip to content

Instantly share code, notes, and snippets.

@mysqlboy
Last active February 6, 2021 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mysqlboy/de9067aa394f31a9adb450ac25fa55d3 to your computer and use it in GitHub Desktop.
Save mysqlboy/de9067aa394f31a9adb450ac25fa55d3 to your computer and use it in GitHub Desktop.
Xtrabackup
# Start netcat on port 9999 on joiner
nc -l -p 9999 | xbstream -x -C .
# Start the backup from donor
innobackupex \
--compress \
--compress-threads=4 \
--parallel=4 \
--stream=xbstream . \
| nc 9999
## Prepare the backup for recovery
# Decompress the backup files and remove the compressed version
xtrabackup --target-dir=. --decompress --remove-original
# Apply the innodb redo log to the data files
xtrabackup --target-dir=. --prepare
# Modify recursively the file ownership to ensure service user owns the database assets
chown -R mysql:mysql .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment