From 363f2820e1a189703bbaaa5993eeb112ea96a50c Mon Sep 17 00:00:00 2001 From: Marc Guyer Date: Sat, 21 Dec 2019 12:41:08 -0500 Subject: [PATCH] Some reorg --- content/_index.md | 2 ++ .../introduction.md} | 0 .../testing.md} | 0 ...e-for-mysql-backup-made-with-xtrabackup.md | 22 +++++++++---------- 4 files changed, 13 insertions(+), 11 deletions(-) rename content/posts/{example-application-with-mezzio-introduction.md => example-application-with-mezzio/introduction.md} (100%) rename content/posts/{example-application-with-mezzio-testing.md => example-application-with-mezzio/testing.md} (100%) diff --git a/content/_index.md b/content/_index.md index 76f4a87..5e33cba 100644 --- a/content/_index.md +++ b/content/_index.md @@ -8,3 +8,5 @@ draft: false * REST API and Payment Systems Expert * Open Source Contributor * Private Pilot + +Available for hire - [Ask me anything about your project](//scr.im/marcguyer) diff --git a/content/posts/example-application-with-mezzio-introduction.md b/content/posts/example-application-with-mezzio/introduction.md similarity index 100% rename from content/posts/example-application-with-mezzio-introduction.md rename to content/posts/example-application-with-mezzio/introduction.md diff --git a/content/posts/example-application-with-mezzio-testing.md b/content/posts/example-application-with-mezzio/testing.md similarity index 100% rename from content/posts/example-application-with-mezzio-testing.md rename to content/posts/example-application-with-mezzio/testing.md diff --git a/content/posts/example-recovery-procedure-for-mysql-backup-made-with-xtrabackup.md b/content/posts/example-recovery-procedure-for-mysql-backup-made-with-xtrabackup.md index e8e1e2d..8b8f2b2 100644 --- a/content/posts/example-recovery-procedure-for-mysql-backup-made-with-xtrabackup.md +++ b/content/posts/example-recovery-procedure-for-mysql-backup-made-with-xtrabackup.md @@ -49,12 +49,12 @@ In this particular instance, the complete snapshot backup files and the incremen #### Create a clean working directory and download the snapshot Create a clean directory on the server where you will work with the backup files -```sh +```sh {linenos=false} mkdir /restore_tmp -``` +``` Download the full snapshot: -```sh +```sh {linenos=false} aws s3 cp s3://my-db-backup/xtrabackups/mysqlbackup.qp.xbs /restore_tmp/ ``` @@ -63,46 +63,46 @@ _NOTE: We're using the AWS CLI here. Authentication is accomplished with stored ### 2. Decompress Backup File The following command decompresses the file into the same (current) directory -```sh +```sh {linenos=false} xbstream -x < mysqlbackup.qp.xbs ``` **There are still many compressed files in the result!** The next step is to decompress all compressed files in the current directory and can be done like so: -```sh +```sh {linenos=false} xtrabackup --decompress --remove-original --parallel=8 --target-dir=. ``` ### 3. Prepare the Backup Files Next we need to prepare the backup. This step completes any open transactions or rollbacks that happened during the original backup procedure. -```sh +```sh {linenos=false} xtrabackup --prepare --target-dir=. ``` ### 4. Restore the files The MySQL server must be shut down for this step. -```sh +```sh {linenos=false} systemctl stop mysql ``` The datadir must be empty for restoration. Consider backing up what's there if it's not empty. -```sh +```sh {linenos=false} rm -rf /var/lib/mysql/* ``` Now, move the backup into the datadir with the `xtrabackup` binary. Note that the `--target-dir` is required and is used to indicate where the files will be moved _from_: -```sh +```sh {linenos=false} xtrabackup --move-back --target-dir=. ``` The ownership must change: -```sh +```sh {linenos=false} chown -R mysql:mysql /var/lib/mysql ``` Now we can start the server: -```sh +```sh {linenos=false} systemctl start mysql ```