Skip to content

Commit 168a955

Browse files
Merge pull request #243 from K-Natsugawa/master
update WKS backup/restore README for 4.7.x
2 parents 8a63b79 + e6ba560 commit 168a955

1 file changed

Lines changed: 20 additions & 24 deletions

File tree

knowledge-studio/4.7.x/README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ Any modifications that have been made after the previous `backup` will be replac
1212
backup/restore scripts do backup/restore data in the following databases of WKS in the order:
1313
1. MongoDB
1414
2. PostgreSQL
15-
3. MinIO
15+
3. S3
1616

1717
<b>NOTE</b> Users should not access to WKS during backup/restore because WKS will be deactivated (All deactivated pods will be reactivated after backup/restore)
1818

1919
# Deactivate and Reactivate Knowledge Studio
2020
## Note: You don't need to deactivate/reactivate when you run the all-backup-restore.sh script because the script handles the process.
2121
- Deactivate Knowledge Studio
2222
- Make sure that no training and evaluation processes are running. You can check job status with the following command:
23-
- `kubectl -n NAMESPACE get jobs`
23+
- `oc -n NAMESPACE get jobs`
2424
- raining jobs of Knowledge Studio are named in the format wks-train-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx, and evaluation jobs are named in the format wks-batch-apply-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. If the COMPLETIONS column of a training job reads 0/1, that job is still running. Wait until all of the training jobs finish.
2525
- Deactivate Knowledge Studio with the following command:
26-
- `kubectl -n NAMESPACE patch --type=merge wks wks -p '{"spec":{"global":{"quiesceMode":true}}}'`
26+
- `oc -n NAMESPACE patch --type=merge wks wks -p '{"spec":{"global":{"quiesceMode":true}}}'`
2727
- Make sure no Knowledge Studio pods exist except datastore pods by the following command (this may takes few minutes):
28-
- `kubectl -n NAMESPACE get pod | grep -Ev 'minio|etcd|mongo|postgresql|gw-instance|Completed' | grep wks`
28+
- `oc -n NAMESPACE get pod | grep -Ev 'minio|etcd|mongo|postgresql|gw-instance|Completed' | grep wks`
2929

3030
- Reactivate Knowledge Studio
3131
- Reactivate Knowledge Studio with the following command:
32-
- `kubectl -n NAMESPACE patch --type=merge wks wks -p '{"spec":{"global":{"quiesceMode":false}}}'`
32+
- `oc -n NAMESPACE patch --type=merge wks wks -p '{"spec":{"global":{"quiesceMode":false}}}'`
3333

3434
# About backup/restore scripts
3535
## all-backup-restore.sh [command] [releaseName] [backupDir] [-n namespace]
3636
### Overall
37-
This script delegates operations of backup/restore to each database scripts (`mongodb-backup-restore.sh`, `postgresql-backup-restore.sh`, `minio-backup-restore.sh`). The order of getting backup/restore is MongoDB, PostgreSQL, MinIO. Besides, at the beginning of this script, scale down the number of pods to zero. At the end of this script, scale up the number of pods to the initial state. <b>We would recommend running `all-backup-restore.sh` rather than running each database scripts.</b>
37+
This script delegates operations of backup/restore to each database scripts (`mongodb-backup-restore.sh`, `postgresql-backup-restore.sh`, `s3-backup-restore.sh`). The order of getting backup/restore is MongoDB, PostgreSQL, S3. Besides, at the beginning of this script, scale down the number of pods to zero. At the end of this script, scale up the number of pods to the initial state. <b>We would recommend running `all-backup-restore.sh` rather than running each database scripts.</b>
3838

3939
### Prerequisite
4040

41-
MinIO client (`mc` command) is required to run backup/restore scripts of MinIO.
41+
S3 (Minio) client (`mc` command) is required to run backup/restore scripts of S3/Minio.
4242
Please verify that `mc` command is runnable by `type mc` command.
4343
Otherwise, scripts will download it from MinIO web site (`https://dl.min.io/`) during backup/restore.
4444

@@ -48,24 +48,24 @@ backup/restore scripts do backup/restore data in the following databases of WKS
4848
- `restore`: data of each database are recovered by loading data from backup directories.
4949
- `[releaseName]`: release name. you can find it at prefix of pod name, e.g. `{release_name}-ibm-watson-ks-yyy-xxx`
5050
- In 2020 June release, `{release_name}` is always `wks`
51-
- `[backupDir]`: Backup data of MongoDB, PostgreSQL, Minio are stored respectively into these directories. Each database is also restored loading backup data from these directories:
51+
- `[backupDir]`: Backup data of MongoDB, PostgreSQL, S3 are stored respectively into these directories. Each database is also restored loading backup data from these directories:
5252
- `backup`: a new folder with timestamp `wks-backup-yyyymmdd_hhmmss` will be created under [backupDir]:
5353
- `[backupDir]/wks-backup-yyyymmdd_hhmmss/mongodb`
5454
- `[backupDir]/wks-backup-yyyymmdd_hhmmss/postgresql`
55-
- `[backupDir]/wks-backup-yyyymmdd_hhmmss/minio`
56-
- `restore`: please set [backupDir] with `wks-backup-yyyymmdd_hhmmss`:
55+
- `[backupDir]/wks-backup-yyyymmdd_hhmmss/s3`
56+
- `restore`: please set [backupDir] with the name `wks-backup-yyyymmdd_hhmmss` and ensure that the fallowing folders are located within the directory:
5757
- `[backupDir]/mongodb`
5858
- `[backupDir]/postgresql`
59-
- `[backupDir]/minio`
59+
- `[backupDir]/s3` ( or `[backupDir]/minio` if the backup data is from previous version, such as 4.6.x or 4.5.x )
6060
- `[-n namespace]`: namespace where pods exist
6161
- default namespace is `zen` (if you do not change it)
6262

6363
### Status
6464
Please verify that the success message is shown in console log when all scripts succeed.
65-
- `[SUCCESS] MongoDB,PostgreSQL,Minio (backup|restore)`
65+
- `[SUCCESS] MongoDB,PostgreSQL,S3 (backup|restore)`
6666

6767
Otherwise, some of scripts fail when the fail message is shown. <b>In this case, backup data is corrupted, so please do NOT use the corrupted backup data to restore.</b>
68-
- `[FAIL] MongoDB,PostgreSQL,Minio (backup|restore)`
68+
- `[FAIL] MongoDB,PostgreSQL,S3 (backup|restore)`
6969

7070
## mongodb-backup-restore.sh [command] [releaseName] [backupDir] [-n namespace]
7171

@@ -102,23 +102,19 @@ backup/restore scripts do backup/restore data in the following databases of WKS
102102
2. Restore the databases (`jobq_{release_name_underscore}`, `model_management_api` and `model_management_api_v2`) by loading `.custom` files under `[backupDir]`.
103103
3. Delete `.pgpass`
104104

105-
## minio-backup-restore.sh [command] [releaseName] [backupDir] [-n namespace]
105+
## S3-backup-restore.sh [command] [releaseName] [backupDir] [-n namespace]
106106

107107
Before backup/restore:
108108

109109
Deactivate Knowledge Studio before backup/restore and Reactivate Knowledge Studio after backup/restore.
110110

111111
### Backup
112-
Get backup of MinIO by getting snapshot.
112+
Get backup of S3 by getting snapshot.
113113

114-
1. `kubectl -n {namespace} port-forward` to a pod with prefix `{release_name}-ibm-minio` in background.
115-
2. Configure minio alias, `wks-minio`
116-
3. Copy all data from `wks-minio/wks-icp` to `{backupDir}`
117-
4. Finish `kubectl -n {namespace} port-forward`
114+
1. Configure S3 alias: `wks`
115+
2. Copy all data from `wks/wks-icp` to `{backupDir}`
118116

119117
### Restore
120-
Restore the backup data to MinIO. Delete all the existing data of MinIO before restoring data.
121-
1. `kubectl -n {namespace} port-forward` to a pod with prefix `{release_name}-ibm-minio` in background.
122-
2. Configure minio alias, `wks-minio`
123-
3. Copy all data from `{backupDir}` to `wks-minio/wks-icp`
124-
4. Finish `kubectl -n {namespace} port-forward`
118+
Restore the backup data to S3.
119+
2. Configure S3 alias: `wks`
120+
3. Copy all data from `{backupDir}` to `wks/wks-icp`

0 commit comments

Comments
 (0)