Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update log backup user docs #2641

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
12939f6
subcommands
RidRisR Oct 25, 2024
10092d5
stop
RidRisR Oct 25, 2024
1cb9ff6
crd
RidRisR Oct 25, 2024
e3d72d7
Update en/backup-to-aws-s3-using-br.md
RidRisR Nov 11, 2024
52450ed
Update en/backup-to-aws-s3-using-br.md
RidRisR Nov 11, 2024
8674d2c
fix
RidRisR Nov 11, 2024
99f9953
lint
RidRisR Nov 12, 2024
21e686b
lint
RidRisR Nov 12, 2024
1c333ce
lint
RidRisR Nov 12, 2024
8e6533e
Update zh/backup-to-aws-s3-using-br.md
RidRisR Nov 25, 2024
95d1c68
fix comment
RidRisR Nov 28, 2024
fd68f5b
modify more examples
RidRisR Nov 28, 2024
a7fc814
lint
RidRisR Nov 28, 2024
9252218
add version
RidRisR Nov 28, 2024
dc23a0d
Update zh/backup-restore-overview.md
RidRisR Nov 28, 2024
ef1a001
Update en/backup-to-aws-s3-using-br.md
RidRisR Nov 28, 2024
33b1b74
Update en/backup-to-aws-s3-using-br.md
RidRisR Nov 28, 2024
1bf5060
fix comment
RidRisR Nov 28, 2024
5132b8b
use -
RidRisR Nov 28, 2024
2770c85
lint
RidRisR Nov 28, 2024
461ed2a
fix
RidRisR Nov 28, 2024
be007a3
fix
RidRisR Nov 28, 2024
6882037
replace • with -
RidRisR Nov 29, 2024
ce5ac2d
lint
RidRisR Nov 29, 2024
7dda757
Discard changes to .markdownlint.yaml
Oreoxmt Dec 25, 2024
f869a85
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
1534f5e
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
ee452f7
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
168ed6b
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
015a4d2
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
1296659
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
760b637
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
f13a5cf
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
dbb04fd
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
05e8505
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
f29b5fa
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
734177c
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
55b2671
Update zh/backup-to-azblob-using-br.md
RidRisR Dec 26, 2024
041af46
Update zh/backup-to-gcs-using-br.md
RidRisR Dec 26, 2024
f80c664
Update zh/backup-to-gcs-using-br.md
RidRisR Dec 26, 2024
8f56e79
Update zh/backup-restore-cr.md
RidRisR Dec 26, 2024
0268bf1
Update zh/backup-restore-overview.md
RidRisR Dec 26, 2024
ec8d4f0
Update zh/backup-to-aws-s3-using-br.md
RidRisR Dec 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions en/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ Because you already created a `Backup` CR named `demo1-log-backup-s3` when you s
kubectl edit backup demo1-log-backup-s3 -n backup-test
```

In the last line of the CR, change the `logSubcommand` to `log-pause`. Then save and quit the editor. The modified content is as follows:
Change the `logSubcommand` to `log-stop`. Then save and quit the editor. The modified content is as follows:

```yaml
---
Expand All @@ -432,6 +432,7 @@ metadata:
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand All @@ -457,11 +458,13 @@ demo1-log-backup-s3 log Stopped ....

<Tip>
Stopped is the terminated state of a log backup CR, you couldn't change the state again, but you still could clean log backup data.

In v1.5.5 and earlier TiDB Operator versions, you could use the logStop: true/false field to stop or start a task. This field is retained for backward compatibility.
RidRisR marked this conversation as resolved.
Show resolved Hide resolved
</Tip>

#### Clean log backup data

1. Because you already created a `Backup` CR named `demo1-log-backup-s3` when you started log backup, you can clean the log data backup by modifying the same `Backup` CR. The priority of all operations is: stop log backup > delete log backup data > start log backup. The following example shows how to clean log backup data generated before 2022-10-10T15:21:00+08:00.
1. Because you already created a `Backup` CR named `demo1-log-backup-s3` when you started log backup, you can clean the log data backup by modifying the same `Backup` CR. The following example shows how to clean log backup data generated before 2022-10-10T15:21:00+08:00.

```shell
kubectl edit backup demo1-log-backup-s3 -n backup-test
Expand All @@ -478,6 +481,7 @@ Stopped is the terminated state of a log backup CR, you couldn't change the stat
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-start/log-pause/log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand Down
2 changes: 1 addition & 1 deletion zh/backup-restore-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ kubectl delete backupschedule ${name} -n ${namespace}

如果你使用 v1.1.2 及以前版本,或使用 v1.1.3 及以后版本并将 `spec.cleanPolicy` 设置为 `Delete` 时,TiDB Operator 在删除 CR 时会同时清理备份文件。

如果你使用v1.5及以后的版本,当你删除CR时,TiDB Operator会尝试自动停止正在运行的日志备份任务。自动停止功能只会停止正常运行的日志备份任务,并不处理错误或者失败的任务。
如果你使用 v1.5.5, v1.6.1 及以后的版本,当你删除CR时,TiDB Operator 会尝试自动停止正在运行的日志备份任务。自动停止功能只会停止正常运行的日志备份任务,并不处理错误或者失败的任务。
RidRisR marked this conversation as resolved.
Show resolved Hide resolved

如果你使用基于 AWS EBS 卷快照的备份,并将 `spec.cleanPolicy` 设置为 `Delete` 时,TiDB Operator 在删除 CR 以及清理备份文件的同时删除 AWS 上相关的所有卷快照。

Expand Down
9 changes: 6 additions & 3 deletions zh/backup-to-aws-s3-using-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ demo1-log-backup-s3 log Running ....
kubectl edit backup demo1-log-backup-s3 -n backup-test
```

在 CR 的最后一行,将 logSubcommand 更改为 log-pause。然后保存并退出编辑器。修改后的内容如下:
将 logSubcommand 更改为 log-stop。然后保存并退出编辑器。修改后的内容如下:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
将 logSubcommand 更改为 log-stop然后保存并退出编辑器。修改后的内容如下:
`logSubcommand` 的值修改为 `log-stop`然后保存并退出编辑器。修改后的内容如下:


```yaml
---
Expand All @@ -428,6 +428,7 @@ metadata:
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-stop
br:
cluster: demo1
clusterNamespace: test1
Expand All @@ -438,7 +439,6 @@ spec:
region: us-west-1
bucket: my-bucket
prefix: my-log-backup-folder
logStop: true
```

可以看到名为 `demo1-log-backup-s3` 的 `Backup` CR 的 `STATUS` 从 `Running` 变成了 `Stopped`:
Expand All @@ -454,11 +454,13 @@ demo1-log-backup-s3 log Stopped ....

<Tip>
Stopped 是日志备份的终止状态,此状态下无法再次更改状态,但你仍然可以清理日志备份的数据。

在 v1.5.5 及更早版本的 TiDB Operator 中,可以使用 logStop: true/false 字段来停止或启动任务。此字段为了向后兼容而保留。
</Tip>

#### 清理日志备份数据

1. 由于你在开启日志备份的时候已经创建了名为 `demo1-log-backup-s3` 的 `Backup` CR,因此可以直接更新该 `Backup` CR 的配置,来激活清理日志备份数据的操作。操作激活优先级从高到低分别是停止日志备份任务、删除日志备份数据和开启日志备份任务。执行如下操作来清理 2022-10-10T15:21:00+08:00 之前的所有日志备份数据。
1. 由于你在开启日志备份的时候已经创建了名为 `demo1-log-backup-s3` 的 `Backup` CR,因此可以直接更新该 `Backup` CR 的配置,来激活清理日志备份数据的操作。执行如下操作来清理 2022-10-10T15:21:00+08:00 之前的所有日志备份数据。

```shell
kubectl edit backup demo1-log-backup-s3 -n backup-test
Expand All @@ -475,6 +477,7 @@ Stopped 是日志备份的终止状态,此状态下无法再次更改状态,
namespace: backup-test
spec:
backupMode: log
logSubcommand: log-start/log-pause/log-stop
RidRisR marked this conversation as resolved.
Show resolved Hide resolved
br:
cluster: demo1
clusterNamespace: test1
Expand Down