Skip to content

Commit 5ec7792

Browse files
authored
Merge pull request #593 from hayleyling/trans
Doc: Add backup_cron in English #564
2 parents 4ea1492 + 99a5cc8 commit 5ec7792

9 files changed

+134
-60
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
# What is RadonDB MySQL
2323

24-
**RadonDB MySQL** is an open-source, cloud-native, and high-availability cluster solution based on MySQL. It supports the architecture of one leader node and multiple replicas, with a set of management functions for security, automatic backup, monitoring and alarming, automatic scaling, and so on.
24+
**RadonDB MySQL** is an open-source, cloud-native, and high-availability cluster solution based on MySQL. It adopts the architecture of one leader node and multiple replicas, with management capabilities for security, automatic backups, monitoring and alerting, automatic scaling, and so on.
2525

26-
**RadonDB MySQL Kubernetes** supports installation, deployment and management of RadonDB MySQL clusters on [Kubernetes](https://kubernetes.io/), [KubeSphere](https://kubesphere.com.cn/) and [Rancher](https://rancher.com), and automates tasks involved in running a RadonDB MySQL cluster.
26+
**RadonDB MySQL Kubernetes** supports installation, deployment and management of RadonDB MySQL clusters on [Kubernetes](https://kubernetes.io/), [KubeSphere](https://kubesphere.com.cn/) and [Rancher](https://rancher.com), and automates tasks involved in running RadonDB MySQL clusters.
2727

2828
## Features
2929
🧠 **High-availability MySQL**: Automatic decentralized leader election, failover within seconds, and strong data consistency in cluster switching
@@ -32,7 +32,7 @@
3232

3333
💻 **Monitoring and alerting**
3434

35-
✍️ [**Backup for S3**](docs/en-us/deploy_backup_restore_s3.md)
35+
✍️ [**S3 backups**](docs/en-us/backup_and_restoration_s3.md) and [**NFS backups**](docs/en-us/backup_and_restoration_nfs.md)
3636

3737
🎈 **Log management**
3838

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
💻 [**监控告警**](docs/zh-cn/deploy_monitoring.md)
3434

35-
✍️ [**备份**](docs/zh-cn/deploy_backup_restore_s3.md)
35+
✍️ [**S3 备份**](docs/zh-cn/backup_and_restoration_s3.md)[**NFS 备份**](docs/zh-cn/backup_and_restoration_nfs.md)
3636

3737
🎈 **集群日志管理**
3838

docs/en-us/deploy_backup_restore_nfs.md renamed to docs/en-us/backup_and_restoration_nfs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
English | [简体中文](../zh-cn/deploy_backup_restore_nfs.md)
1+
English | [简体中文](../zh-cn/backup_and_restoration_nfs.md)
22

33
# Quickstart for NFS backups
44

@@ -31,7 +31,7 @@ In this way, you can install the Pod and Service of the NFS server in the cluste
3131
### 2. Install by kubectl
3232
```shell
3333
kubectl apply -f config/samples/nfs_pv.yaml
34-
kubectl apply -f config/samples/nfs_server.yaml
34+
kubectl apply -f config/samples/nfs_server.yaml
3535
```
3636

3737
## Obtain `nfsServerAddress`
@@ -75,7 +75,7 @@ Configure the `nfsServerAddress` attribute to the NFS server address in the `mys
7575
nfsServerAddress: 10.96.253.82
7676
```
7777
78-
> Notice: `restoreFrom` stands for the pathname of the backup. You can get it by checking the path loaded by the NFS server.
78+
> Notice: `restoreFrom` stands for the path name of the backup. You can get it by checking the path loaded by the NFS server.
7979

8080
Restore cluster from NFS backup as follows.
8181

docs/en-us/deploy_backup_restore_s3.md renamed to docs/en-us/backup_and_restoration_s3.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
English | [简体中文](../zh-cn/deploy_backup_restore_s3.md)
1+
English | [简体中文](../zh-cn/backup_and_restoration_s3.md)
22

3-
Contents
4-
=============
3+
# Quickstart for S3 backups
4+
5+
## Contents
56

67
- [Prerequisites](#Prerequisites)
78
- [Overview](#Overview)
8-
- [Configure the backup for S3](#Configure-the-backup-for-S3)
9+
- [Configure the backup](#Configure-the-backup)
910
- [Step 1: Create the Secret file](#Step-1-Create-the-Secret-file)
1011
- [Step 2: Configure the Secret for the Operator cluster](#Step-2-Configure-the-Secret-for-the-Operator-cluster)
1112
- [Start the backup](#Start-the-backup)
@@ -17,7 +18,7 @@ Contents
1718
## Overview
1819
This tutorial displays how to back up and restore the deployed RadonDB MySQL Operator cluster.
1920

20-
## Configure the S3 backup
21+
## Configure the backup
2122

2223
### Step 1: Create the Secret file
2324
```yaml
@@ -44,7 +45,7 @@ Then, create the backup Secret.
4445
kubectl create -f config/samples/backup_secret.yaml
4546
```
4647
47-
### Step 2: Configure the Secret for the Operator cluster
48+
### Step 2: Configure the backup Secret for the Operator cluster
4849
Configure the `backupSecretName` property in `mysql_v1alpha1_mysqlcluster.yaml`, for example, `sample-backup-secre`.
4950
5051
```yaml
@@ -67,14 +68,14 @@ spec:
6768
clusterName: sample
6869

6970
```
70-
| Name | Description |
71-
|------|--------|
72-
|hostName|pod name in cluser|
73-
|clusterName|cluster name|
71+
| Parameter | Description |
72+
| ----------- | ------------ |
73+
| hostName | Pod name |
74+
| clusterName | Cluster name |
7475

7576
## Start the backup
7677

77-
Before starting backup, you need to start the cluster.
78+
Before starting the backup, you need to start the cluster.
7879

7980
```shell
8081
kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml
@@ -89,7 +90,7 @@ backup-sample sample_2022526155115 2022-05-26T15:51:15 S3
8990
```
9091

9192
## Restore the cluster from the backup
92-
Check the S3 bucket and set the `RestoreFrom` property in the `mysql_v1alpha1_backup.yaml` file to the backup directory, for example, `sample_2022526155115`.
93+
Check the S3 bucket and set the `RestoreFrom` property in the `mysql_v1alpha1_mysqlcluster.yaml` file to the backup directory, for example, `sample_2022526155115`.
9394

9495
```yaml
9596
...

docs/en-us/backup_cron.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Contents
2+
=============
3+
- [Overview](#overview)
4+
- [Configuration of scheduled backups](#configuration-of-scheduled-backups)
5+
- [Cron expression format](#cron-expression-format)
6+
- [Special characters](#special-characters)
7+
- [Predefined schedules](#predefined-schedules)
8+
9+
# Overview
10+
The scheduled backup is currently supported for both S3 and NFS backups. You can use the cron expression to specify the backup schedule. Set the `backupSchedule` parameter under the `spec` field in the YAML file of the cluster, for example:
11+
12+
```yaml
13+
...
14+
spec:
15+
replicas: 3
16+
mysqlVersion: "5.7"
17+
backupSchedule: "0 0 0 * * *" # daily
18+
...
19+
```
20+
# Configuration of scheduled backups
21+
22+
## Cron expression format
23+
24+
A cron expression represents a set of times, using 6 space-separated fields in the format of `[second] [minute] [hour] [day] [month] [day of week]`.
25+
26+
| Field name | Mandatory | Allowed values | Allowed special characters |
27+
| ------------ | --------- | --------------- | -------------------------- |
28+
| Seconds | Yes | 0-59 | * / , - |
29+
| Minutes | Yes | 0-59 | * / , - |
30+
| Hours | Yes | 0-23 | * / , - |
31+
| Day of month | Yes | 1-31 | * / , - ? |
32+
| Month | Yes | 1-12 or JAN-DEC | * / , - |
33+
| Day of week | Yes | 0-6 or SUN-SAT | * / , - ? |
34+
35+
> Note: `Month` and `Day-of-week` field values are case-insensitive. `SUN`, `Sun`, and `sun` are equally accepted.
36+
37+
### Special characters
38+
Asterisk ( * )
39+
40+
The asterisk indicates that the cron expression will match for all values of the field. For example, using an asterisk in the 5th field (month) would indicate every month.
41+
42+
Slash ( / )
43+
44+
Slashes are used to describe increments of ranges. For example `3-59/15` in the 1st field (minutes) would indicate the 3rd minute of the hour and every 15 minutes thereafter. The form `*\/...` is equivalent to the form `first-last/...`, that is, an increment over the largest possible range of the field. The form `N/...` is accepted as meaning `N-MAX/...`, that is, starting at `N`, use the increment until the end of that specific range. It does not wrap around.
45+
46+
Comma ( , )
47+
48+
Commas are used to separate items of a list. For example, using `MON,WED,FRI` in the 5th field (day of week) would mean Mondays, Wednesdays and Fridays.
49+
50+
Hyphen ( - )
51+
52+
Hyphens are used to define ranges. For example, `9-17` would indicate every hour between 9am and 5pm inclusive.
53+
54+
Question mark ( ? )
55+
56+
Question mark may be used instead of `*` for leaving either day-of-month or day-of-week blank.
57+
58+
### Predefined schedules
59+
60+
You may use one of several pre-defined schedules in place of a cron expression.
61+
62+
| Entry | Description | Equivalent To |
63+
| ---------------------- | ------------------------------------------ | ------------- |
64+
| @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 * |
65+
| @monthly | Run once a month, midnight, first of month | 0 0 0 1 * * |
66+
| @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0 |
67+
| @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * |
68+
| @hourly | Run once an hour, beginning of hour | 0 0 * * * * |

docs/zh-cn/deploy_backup_restore_nfs.md renamed to docs/zh-cn/backup_and_restoration_nfs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[English](../en-us/deploy_backup_restore_nfs.md) | 简体中文
1+
[English](../en-us/backup_restoration_nfs.md) | 简体中文
22

33
# NFS 备份快速手册
44

docs/zh-cn/deploy_backup_restore_s3.md renamed to docs/zh-cn/backup_and_restoration_s3.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[English](../en-us/deploy_backup_restore_s3.md) | 简体中文
1+
[English](../en-us/backup_restoration_s3.md) | 简体中文
22

3-
目录
4-
=============
3+
# S3 备份快速手册
54

5+
## 目录
66
- [前提条件](#前提条件)
77
- [简介](#简介)
8-
- [配置 backup](#配置-backup)
9-
- [步骤 1: 添加 Secret 文件](#1-添加-secret-文件)
10-
- [步骤 2: 将 Secret 配置到 Operator 集群](#2-将-secret-配置到-Operator-集群)
8+
- [配置备份](#配置备份)
9+
- [步骤 1: 添加 Secret 文件](#步骤-1-添加-secret-文件)
10+
- [步骤 2: 将 Secret 配置到 Operator 集群](#步骤-2-将-secret-配置到-operator-集群)
1111
- [启动备份](#启动备份)
1212
- [从备份副本恢复到新集群](#从备份副本恢复到新集群)
1313

@@ -19,9 +19,9 @@
1919

2020
本文档介绍如何对部署的 RadonDB MySQL Operator 集群进行备份和恢复。
2121

22-
## 配置 backup
22+
## 配置备份
2323

24-
### 步骤 1: 添加 Secret 文件
24+
### 步骤 1: 创建 Secret 配置文件
2525
```yaml
2626
kind: Secret
2727
apiVersion: v1
@@ -36,17 +36,17 @@ data:
3636
type: Opaque
3737

3838
```
39-
s3-xxxx 值用 base64 编码,注意不要把换行符编码进去,可以用如下命令获取 base64 编码:
39+
`s3-xxxx` 字段的值采用 base64 编码,注意不要包含换行符的编码。您可以用如下命令获取 base64 编码:
4040
```
4141
echo -n "替换为您的S3-XXX值"|base64
4242
```
43-
随后,用如下命令创建备份 Secret:
43+
然后,使用如下命令创建备份 Secret:
4444
4545
```
4646
kubectl create -f config/samples/backup_secret.yaml
4747
```
4848
### 步骤 2: 将 Secret 配置到 Operator 集群
49-
将备份 Secret 名称添加到 mysql_v1alpha1_mysqlcluster.yaml 中,本例中名称为 sample-backup-secret:
49+
将备份 Secret 名称添加到 `mysql_v1alpha1_mysqlcluster.yaml` 中,本例中的名称为 `sample-backup-secret`
5050
5151
```yaml
5252
spec:
@@ -55,7 +55,7 @@ spec:
5555
backupSecretName: sample-backup-secret
5656
...
5757
```
58-
如下创建备份YAML文件`mysql_v1alpha1_backup`.yaml:
58+
如下创建备份 YAML 配置文件 `mysql_v1alpha1_backup.yaml`
5959

6060
```yaml
6161
apiVersion: mysql.radondb.com/v1alpha1
@@ -68,27 +68,27 @@ spec:
6868
clusterName: sample
6969

7070
```
71-
| 参数名 | 描述 |
72-
|------|--------|
73-
|hostName| 集群中Pod的名称 |
74-
|clusterName| 数据库集群名称 |
71+
| 参数名 | 描述 |
72+
| ----------- | --------------- |
73+
| hostName | 集群中 Pod 的名称 |
74+
| clusterName | 数据库集群名称 |
7575

7676

7777
## 启动备份
7878
启动集群后,才可以进行备份操作。
7979
```shell
8080
kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml
8181
```
82-
执行成功后,可以通过如下命令查看备份状况
82+
执行成功后,可以通过如下命令查看备份状况
8383
```
8484
kubectl get backups.mysql.radondb.com
8585
NAME BACKUPNAME BACKUPDATE TYPE
8686
backup-sample sample_2022526155115 2022-05-26T15:51:15 S3
8787
```
8888

8989
## 从备份副本恢复到新集群
90-
检查您的 S3 bucket,得到您需要的备份文件夹如 `sample_2022526155115`
91-
添加 RestoreFrom 字段到 mysql_v1alpha1_backup.yaml,如下:
90+
检查您的 S3 bucket,得到您需要的备份文件夹,如 `sample_2022526155115`
91+
`mysql_v1alpha1_mysqlcluster.yaml` 中添加 `RestoreFrom` 字段,如下:
9292

9393
```yaml
9494
...

docs/zh-cn/backup_cron.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
目录
22
=============
3+
- [简介](#简介)
4+
- [定时备份配置方式](#定时备份配置方式)
5+
- [Cron 表达式格式](#cron-表达式格式)
6+
- [特殊字符](#特殊字符)
7+
- [预定义时间表](#预定义时间表)
38

49
# 简介
5-
目前,无论 S3 还是 NFS 备份,均支持定时备份,并支持使用 crontab 表达式来指定备份的时间策略。您只需直接在集群的 YAML 文件的 `spec` 下设置 `backupSchedule` 字段。例如:
10+
目前,无论 S3 还是 NFS 备份,均支持定时备份,并支持使用 Cron 表达式来指定备份的时间策略。您只需直接在集群的 YAML 文件的 `spec` 下设置 `backupSchedule` 字段。例如:
611

712
```yaml
813
...
@@ -14,19 +19,19 @@ spec:
1419
```
1520
# 定时备份配置方式
1621

17-
## cron 表达式格式
22+
## Cron 表达式格式
1823

19-
cron 表达式的格式为: `[秒] [分] [时] [日] [月] [星期]`即由6个使用空格分隔的字段组成的时间组合
24+
Cron 表达式的格式为: `[秒] [分] [时] [日] [月] [星期]`即由 6 个使用空格分隔的字段组成的时间组合
2025

2126

22-
字段名 | 必配 | 允许值 | 允许的特殊符号
23-
---------- | ---------- | -------------- | --------------------------
24-
| 是 | 0-59 | * / , -
25-
| 是 | 0-59 | * / , -
26-
| 是 | 0-23 | * / , -
27-
日 | 是 | 1-31 | * / , - ?
28-
| 是 | 1-12 or JAN-DEC | * / , -
29-
星期 | 是 | 0-6 or SUN-SAT | * / , - ?
27+
| 字段名 | 必配 | 允许值 | 允许的特殊符号 |
28+
| ------ | ---- | --------------- | -------------- |
29+
| || 0-59 | * / , - |
30+
| || 0-59 | * / , - |
31+
| || 0-23 | * / , - |
32+
| || 1-31 | * / , - ? |
33+
| || 1-12 JAN-DEC | * / , - |
34+
| 星期 || 0-6 SUN-SAT | * / , - ? |
3035

3136
> 注意:```星期` 字段值大小写不敏感,即 `SUN`, `Sun`, 和 `sun` 均接受。
3237
@@ -51,14 +56,14 @@ cron 表达式的格式为: `[秒] [分] [时] [日] [月] [星期]`,即由6
5156

5257
不指定值,仅日期和星期域支持该字符。当日期或星期域其中之一被指定了值以后,为了避免冲突,需要将另一个域的值设为`?`
5358

54-
@ 符号
59+
### 预定义时间表
5560

56-
你可以用如下的预定义时间来代替 cron 表达式。
61+
你可以用如下的预定义时间来代替 Cron 表达式。
5762

58-
值 | 描述 | 等同于
59-
----- | ----------- | -------------
60-
@yearly(或 @annually) | 每年执行一次,在 1 月 1 日夜晚 12 点执行 | 0 0 0 1 1 *
61-
@monthly | 每月执行一次,在每月第 1 天 夜晚 12 点执行 | 0 0 0 1 * *
62-
@weekly | 每周执行一次,在周六和周日之间的夜晚 12 点执行 | 0 0 0 * * 0
63-
@daily(或 @midnight) | 每日执行一次,在夜晚 12 点执行 | 0 0 0 * * *
64-
@hourly | 每小时执行一次,在第 1 分钟执行 | 0 0 * * * *
63+
| | 描述 | 等同于 |
64+
| ----------------------- | ---------------------------------------------- | ----------- |
65+
| @yearly(或 @annually| 每年执行一次,在 1 月 1 日夜晚 12 点执行 | 0 0 0 1 1 * |
66+
| @monthly | 每月执行一次,在每月第 1 天 夜晚 12 点执行 | 0 0 0 1 * * |
67+
| @weekly | 每周执行一次,在周六和周日之间的夜晚 12 点执行 | 0 0 0 * * 0 |
68+
| @daily(或 @midnight| 每日执行一次,在夜晚 12 点执行 | 0 0 0 * * * |
69+
| @hourly | 每小时执行一次,在第 1 分钟执行 | 0 0 * * * * |

docs/zh-cn/mgt_mysqluser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* [5.1 Secret](#5.1-Secret)
1616
* [5.2 MysqlUser](#5.2-MysqlUser)
1717

18-
# 使用 MysqlUser CRD 管理 MySQL用户
18+
# 使用 MysqlUser CRD 管理 MySQL 用户
1919

2020
## 1. 前提条件
2121

0 commit comments

Comments
 (0)