wangtianyi2004 commented on code in PR #1574: URL: https://github.com/apache/doris-website/pull/1574#discussion_r1898871810
########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/data-admin/backup-restore/backup.md: ########## @@ -0,0 +1,259 @@ +--- +{ + "title": "备份", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +有关备份的概念,请参阅[备份与恢复](./overview.md)。本指南提供了创建 Repository 和备份数据的操作步骤。 + +## 1. 创建 Repository + +<!-- +suites/backup_restore/test_create_and_drop_repository.groovy +--> + +根据您的存储选择适当的语句来创建 Repository。有关详细用法,请参阅[创建 Repository ](../../sql-manual/sql-statements/data-modification/backup-and-restore/CREATE-REPOSITORY.md)。在不同集群使用相同路径的 Repository 进行备份时,请确保使用不同的 label,以避免冲突造成数据错乱。 + +### Option 1: 在 S3 上创建 Repository Review Comment: 这里写清楚 AWS S3 ########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/data-admin/backup-restore/backup.md: ########## @@ -0,0 +1,259 @@ +--- +{ + "title": "备份", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +有关备份的概念,请参阅[备份与恢复](./overview.md)。本指南提供了创建 Repository 和备份数据的操作步骤。 + +## 1. 创建 Repository + +<!-- +suites/backup_restore/test_create_and_drop_repository.groovy +--> + +根据您的存储选择适当的语句来创建 Repository。有关详细用法,请参阅[创建 Repository ](../../sql-manual/sql-statements/data-modification/backup-and-restore/CREATE-REPOSITORY.md)。在不同集群使用相同路径的 Repository 进行备份时,请确保使用不同的 label,以避免冲突造成数据错乱。 + +### Option 1: 在 S3 上创建 Repository + +要在 S3 存储上创建 Repository ,请使用以下 SQL 命令: + +```sql +CREATE REPOSITORY `s3_repo` +WITH S3 +ON LOCATION "s3://bucket_name/s3_repo" +PROPERTIES +( + "s3.endpoint" = "s3.us-east-1.amazonaws.com", + "s3.region" = "us-east-1", + "s3.access_key" = "ak", + "s3.secret_key" = "sk" +); +``` + +- 将 bucket_name 替换为您的 S3 存储桶名称。 +- 提供适当的 endpoint、access key、 secret key 和 region 以进行 S3 设置。 + +### Option 2: 在 Azure 上创建 Repository + +要在 Azure 存储上创建 Repository ,请使用以下 SQL 命令: + +```sql +CREATE REPOSITORY `azure_repo` +WITH S3 +ON LOCATION "s3://bucket_name/azure_repo" +PROPERTIES +( + "s3.endpoint" = "selectdbcloudtestwestus3.blob.core.windows.net", + "s3.region" = "dummy_region", + "s3.access_key" = "ak", + "s3.secret_key" = "sk", + "provider" = "AZURE" +); +``` + +- 将 bucket_name 替换为您的 Azure 容器名称。 +- 提供您的 Azure 存储帐户和密钥以进行身份验证。 +- `s3.region` 只是一个虚假的 region。 Review Comment: 虚假的 region 是指什么。是不需要提供吗? ########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/data-admin/backup-restore/restore.md: ########## @@ -0,0 +1,148 @@ +--- +{ + "title": "恢复", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## 前提条件 + +1. 确保您拥有**管理员**权限以执行恢复操作。 +2. 确保您有一个现有的**Repository**来存储备份。如果没有,请按照创建 Repository 的步骤并执行[备份](backup.md)。 +3. 确保您有一个有效的**备份**快照可供恢复。 + +## 1. 获取快照的备份时间戳 + +以下SQL语句可用于查看名为`example_repo`的 Repository 中的现有备份。 + + ```sql + mysql> SHOW SNAPSHOT ON example_repo; + +-----------------+---------------------+--------+ + | Snapshot | Timestamp | Status | + +-----------------+---------------------+--------+ + | exampledb_20241225 | 2022-04-08-15-52-29 | OK | + +-----------------+---------------------+--------+ + 1 row in set (0.15 sec) + ``` + +## 2. 从快照恢复 + +### Option 1:恢复快照到当前数据库 + +以下SQL语句从名为`example_repo`的 Repository 中恢复标签为 `restore_label1` 和时间戳为 `2022-04-08-15-52-29` 的快照到当前数据库。 + +```sql +RESTORE SNAPSHOT `restore_label1` +FROM `example_repo` +PROPERTIES +( + "backup_timestamp"="2022-04-08-15-52-29" +); +``` + +### Option 2:恢复快照到指定数据库 + +以下SQL语句从名为`example_repo`的 Repository 中恢复标签为 `restore_label1` 和时间戳为 `2022-04-08-15-52-29` 的快照到名为 `destdb` 的数据库。 + +```sql +RESTORE SNAPSHOT destdb.`restore_label1` +FROM `example_repo` +PROPERTIES +( + "backup_timestamp"="2022-04-08-15-52-29" +); +``` + +### Option 3:从快照恢复单个表 + +从`example_repo`中的快照恢复表`backup_tbl`到当前数据库,快照的标签为 `restore_label1`,时间戳为 `2022-04-08-15-52-29`。 + +```sql +RESTORE SNAPSHOT `restore_label1` +FROM `example_repo` +ON ( `backup_tbl` ) +PROPERTIES +( + "backup_timestamp"="2022-04-08-15-52-29" +); +``` + +### Option 4:从快照恢复分区和表 + +从`example_repo`中的备份快照`snapshot_2`恢复表`backup_tbl`的分区p1和p2,以及表`backup_tbl2`到当前数据库`example_db1`,并将其重命名为`new_tbl`,快照标签为时间版本为`"2018-05-04-17-11-01"`。 + + ```sql + RESTORE SNAPSHOT `restore_label1` + FROM `example_repo` + ON + ( + `backup_tbl` PARTITION (`p1`, `p2`), + `backup_tbl2` AS `new_tbl` + ) + PROPERTIES + ( + "backup_timestamp"="2022-04-08-15-55-43" + ); + ``` + +## 3. 查看恢复作业的执行情况 Review Comment: 这里有格式错误 ########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/data-admin/backup-restore/backup.md: ########## @@ -0,0 +1,259 @@ +--- +{ + "title": "备份", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +有关备份的概念,请参阅[备份与恢复](./overview.md)。本指南提供了创建 Repository 和备份数据的操作步骤。 + +## 1. 创建 Repository + +<!-- +suites/backup_restore/test_create_and_drop_repository.groovy +--> + +根据您的存储选择适当的语句来创建 Repository。有关详细用法,请参阅[创建 Repository ](../../sql-manual/sql-statements/data-modification/backup-and-restore/CREATE-REPOSITORY.md)。在不同集群使用相同路径的 Repository 进行备份时,请确保使用不同的 label,以避免冲突造成数据错乱。 Review Comment: 请确保使用不同的 label。这个 label 就是 repository-name 吧。直接改成 repository 名称? ########## i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/data-admin/backup-restore/restore.md: ########## @@ -0,0 +1,148 @@ +--- +{ + "title": "恢复", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## 前提条件 + +1. 确保您拥有**管理员**权限以执行恢复操作。 +2. 确保您有一个现有的**Repository**来存储备份。如果没有,请按照创建 Repository 的步骤并执行[备份](backup.md)。 +3. 确保您有一个有效的**备份**快照可供恢复。 Review Comment: 第三个已经有了备份,第二个应该就不需要了。第二项是备份的前置条件。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org