You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUN wget --no-check-certificate "https://d.juicefs.com/juicefs/releases/download/v1.0.2/juicefs-1.0.2-linux-amd64.tar.gz" && tar -zxf "juicefs-1.0.2-linux-amd64.tar.gz" ;\
English | [简体中文](../zh-cn/juicefs_backup_and_restore.md) |
2
+
3
+
目录
4
+
=============
5
+
*[juiceopt backup]()
6
+
*[prerequest](#startup-juiceopt-backup)
7
+
*[configuration](#fill-backup-crds-yaml-configs)
8
+
*[running backup](#running-backup)
9
+
10
+
*[restore](#restore)
11
+
*[prepare job](#prerequest-for-restore)
12
+
*[add configmap](#and-config-map)
13
+
*[config mysql cluster](#config-mysql-clusters-yaml)
14
+
*[app the cluster restore from backup](#use-kubectl-apply-the-yaml)
15
+
16
+
# startup juiceopt backup
17
+
## prerequire
18
+
1. prepare S3 strorage (if you want other types of storage, reference the juicfs document),Obtain the access-key and secret-key . In the example of this article, it use minio ,and the instance is minio-1668754867, and the bucket named `test` so the url is http://test.minio-1668754867.minio:9000/ , you can modify it according your situations, and how to do you can refer to juicefs documents.
19
+
20
+
2. Install the redis , although juicefs also support sqlite as meta data storage, buf if you do so, you should sync the meta file from s3 at first,and I do not recommend it. redis url is the form as follow:
21
+
```
22
+
redis://<redis-server-name/IP>:<port>/<NO of database>
23
+
```
24
+
in the example of this article, redis-server-name is redis-leader, the number of database is 1, So the redis url is `redis://redis-leader:6379/1`
25
+
26
+
3. Verfiy whether it works: suppose the backup directory is juicefs , you can login in Pod's backup container , execute commanas as follow:
I suppose that the cluster you want restore is `sample2`
70
+
### and `config map`
71
+
1. At first give the `config map` a name,name's form is <nameofrestorecluster>-restore, this article suppose that cluster name is sample2, so `config map`'s name is `sample2-restore`
72
+
2. Create config map
73
+
* prepare for juiceopt parameters:
74
+
build a yaml file, named `juiceopt.yaml`, fill it with:
75
+
```
76
+
juiceMeta: <redis url>
77
+
backupSecretName: <S3's secret name>
78
+
juiceName: <backup directory under S3 bucket>
79
+
```
80
+
for example, in the example of this article, juiceopt.yaml is:
81
+
```
82
+
juiceMeta: "redis://redis-leader:6379/1"
83
+
backupSecretName: sample-backup-secret
84
+
juiceName: juicefs
85
+
```
86
+
* use `kubectl create configmap` create a configmap
87
+
configmap has two keys , `from` and `juice.opt` that respectively indicate the cluster has been backuped which we should restore from, and the juice parameter.
88
+
but `date` key is optional, it indicates the time where restore to (format is:"2006-01-02 09:07:41"), if it does not have got this key , it will restore to now, use the commands as follows:
in the example of this article, we suppose the cluster need to restore is sample2, the config method can refer to [radondb cluster configuration](./deploy_radondb-mysql_operator_on_k8s.md)
94
+
### use kubectl apply the yaml
95
+
use `kubectl apply ` apply the yaml file, for the example, use the commands as follow:
0 commit comments