Difference between revisions of "Kubernetes Backup and Restore"
Line 37: | Line 37: | ||
==Performing the Restore== | ==Performing the Restore== | ||
To perform the restore, please log-in into master node of your kubernetes deployment using your credentials, and navigate to folder ~\CleanSlate\k8s_dep. At this folder you will find .\db-restore.sh shell script. This script will perform the restore process from mariadb and mediawiki pod from stated file. File location will be supplied from shell script parameters. | |||
Backup script must be supplied with two parameter | |||
# Database backup filename | |||
# Images file backup filename | |||
below are the example of the restore script command | |||
./db-restore.sh mediafile0809.zip backup0809.sql.gz | |||
meaning, that the restore script will take ~\mount\restore\images\mediafile0809.zip to restore all media file, and ~\mount\restore\mariadb\backup0809.sql.gz as database file. | |||
<nowiki>Insert non-formatted text here</nowiki> | |||
When you issue the command | |||
./db-backup.sh | |||
--------------------------------------------------- | |||
This script will create database backup on folder | |||
~/mount/backup/mariadb/cleanslate_bak_08_29_2021_1548.sql.gz | |||
~/mount/backup/images/mediafile_08_29_2021_1548.zip | |||
--------------------------------------------------- | |||
The script will create files as shown above, once the process is complete, you can inspect the files in worker's node generated by issuing ls command | |||
ls ~/mount/backup/images | |||
ls ~/mount/backup/mariadb | |||
which will show you the files generated as the backup script displayed. |
Revision as of 15:56, 29 August 2021
Foreword
This document is prepared as administrator's guide of MediaWiki implementation on kubernetes to perform backup and restore. Backup and restore will cover for both database stored in mySQL and image media stored in MediaWiki file system.
What you need to perform the task is the console access to worker node of kubernetes' deployment.
Acessing your cluster
Use your credentials to access the worker node of the kubernetes deployment. All the data of the deployment is stored on ~\mount and all underneath directory. Please refer the below diagram.
~\mount
|
|- backup
|- images
|- mariadb
|- restore
|- images
|- mariadb
|- images
|- mariadb
Please noted that backup files are stored in ~\mount\backup\, and files as the result of the backup process will be stored in respective folder.
Performing the Backup
To perform the backup, please log-in into master node of your kubernetes deployment using your credentials, and navigate to folder ~\CleanSlate\k8s_dep. At this folder you will find .\db-backup.sh shell script. This script will perform the backup process from mariadb and mediawiki pod and put the backup result on the worker's node folder as stated in above section.
When you issue the command
./db-backup.sh --------------------------------------------------- This script will create database backup on folder ~/mount/backup/mariadb/cleanslate_bak_08_29_2021_1548.sql.gz ~/mount/backup/images/mediafile_08_29_2021_1548.zip ---------------------------------------------------
The script will create files as shown above, once the process is complete, you can inspect the files in worker's node generated by issuing ls command
ls ~/mount/backup/images ls ~/mount/backup/mariadb
which will show you the files generated as the backup script displayed.
Performing the Restore
To perform the restore, please log-in into master node of your kubernetes deployment using your credentials, and navigate to folder ~\CleanSlate\k8s_dep. At this folder you will find .\db-restore.sh shell script. This script will perform the restore process from mariadb and mediawiki pod from stated file. File location will be supplied from shell script parameters.
Backup script must be supplied with two parameter
- Database backup filename
- Images file backup filename
below are the example of the restore script command
./db-restore.sh mediafile0809.zip backup0809.sql.gz
meaning, that the restore script will take ~\mount\restore\images\mediafile0809.zip to restore all media file, and ~\mount\restore\mariadb\backup0809.sql.gz as database file.
Insert non-formatted text here
When you issue the command
./db-backup.sh
This script will create database backup on folder ~/mount/backup/mariadb/cleanslate_bak_08_29_2021_1548.sql.gz ~/mount/backup/images/mediafile_08_29_2021_1548.zip
The script will create files as shown above, once the process is complete, you can inspect the files in worker's node generated by issuing ls command
ls ~/mount/backup/images ls ~/mount/backup/mariadb which will show you the files generated as the backup script displayed.