From c7738356168f546c0cd4762939e65c26e06082ac Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Thu, 4 Jun 2020 23:04:06 +0800 Subject: [PATCH 01/10] Create backup-and-restore-faq.md --- br/backup-and-restore-faq.md | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 br/backup-and-restore-faq.md diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md new file mode 100644 index 0000000000000..bf854a8517e5e --- /dev/null +++ b/br/backup-and-restore-faq.md @@ -0,0 +1,57 @@ +--- +title: Backup & Restore FAQ +summary: Learn about Frequently Asked Questions (FAQ) and the solutions of BR. +category: FAQ +--- + +# Backup & Restore FAQ + +This document lists the Frequently Asked Questions (FAQ) and the solutions about Backup & Restore (BR). + +If the problems are not covered in this document and cannot be resolved, you can raise questions in the [AskTUG](http://asktug.com) community. + +## What should I do if the error message `could not read local://...:download sst failed` is returned when restoring data + +When restoring data, each node must have access to **all** backup files (SST files). By default, if `local` storage is used, you cannot restore data because the backup files are scattered among different nodes. Therefore, you have to copy the backup file of each TiKV node to the other TiKV nodes. + +It is recommended to mount an NFS disk as a backup disk during backup. For details, see [Back up a single table to a network disk](/br/backup-and-restore-use-cases.md#back-up-a-single-table-to-a-network-disk-recommended). + +## How much does it affect the cluster during BR backup? + +When you use the `oltp_read_only` scenario of `sysbench` to back up to a disk (make sure the backup disk and the service disk are different) at full rate, the cluster QPS is decreased by 15%-25%. The impact on the cluster depends on the table schema. + +To control the impact of backup, you can use the `--ratelimit` parameter to limit the backup rate. + +## Does BR back up system tables? During data restoration, do they raise conflict? + +The system libraries (`information_schema`, `performance_schema`, `mysql`) are filtered out during full backup. For more details, refer to the [Backup Principle](/br/backup-and-restore-tool.md#backup-principle). + +Because these system libraries do not exist in the backup files, no conflict occurs among system tables during data restoration. + +## What should I do to resolve the `Permission denied` error, even if I have tried to run BR using root in vain? + +You need to confirm whether TiKV has access to the backup directory. To back up data, confirm whether TiKV has write privilege. To restore data, confirm whether it has read privilege. + +Running BR with root might fail due to the disk privilege, because the backup files (SST files) are saved by TiKV. + +> **Note:** +> +> You might encounter the same problem during data restoration. When reading the SST files for the first time, the reading privilege is verified. The execution duration of DDL suggests that there might be a long interval between checking the privilege and running BR. You might receive the error message `Permission denied` after waiting for a long time. +> +> Therefore, It is recommended to check the privilege before data restoration. + +## What should I do to resolve the `Io(Os...)` error? + +Almost all of these problems are system call errors that occur when TiKV writes data to the disk. You can check the mounting method and the file system of the backup directory, and try to back up data to another folder or another hard disk. +  +For example, you might encounter the `Code: 22(invalid argument)` error when backing up data to the network disk built by `samba`. + +## Where are the files backed up by BR stored when I use `local` storage? +  +When you use `local` storage, `backupmeta` is generated on the node where BR is running, and backup files are generated on the Leader nodes of each Region. + +## How about the size of the backup data? Are there replicas of the backup? + +During data backup, backup files are generated on the Leader nodes of each Region. Therefore, the size of the backup is equal to the data size, with no redundant replicas. Therefore, the total data size is approximately the total number of TiKV data divided by the number of replicas. + +However, if you want to restore data locally, the number of replicas is equal to that of the TiKV nodes, because each TiKV must have access to all backup files. From 2a3da84769cdaee70cdc4dd6d4029d66c83758f4 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 14:33:03 +0800 Subject: [PATCH 02/10] update wording --- br/backup-and-restore-faq.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index bf854a8517e5e..873bdb4d055bc 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -10,17 +10,17 @@ This document lists the Frequently Asked Questions (FAQ) and the solutions about If the problems are not covered in this document and cannot be resolved, you can raise questions in the [AskTUG](http://asktug.com) community. -## What should I do if the error message `could not read local://...:download sst failed` is returned when restoring data +## What should I do if the error message `could not read local://...:download sst failed` is returned during data restoration? When restoring data, each node must have access to **all** backup files (SST files). By default, if `local` storage is used, you cannot restore data because the backup files are scattered among different nodes. Therefore, you have to copy the backup file of each TiKV node to the other TiKV nodes. It is recommended to mount an NFS disk as a backup disk during backup. For details, see [Back up a single table to a network disk](/br/backup-and-restore-use-cases.md#back-up-a-single-table-to-a-network-disk-recommended). -## How much does it affect the cluster during BR backup? +## How much does it affect the cluster during backup using BR? When you use the `oltp_read_only` scenario of `sysbench` to back up to a disk (make sure the backup disk and the service disk are different) at full rate, the cluster QPS is decreased by 15%-25%. The impact on the cluster depends on the table schema. -To control the impact of backup, you can use the `--ratelimit` parameter to limit the backup rate. +To reduce the impact on the cluster, you can use the `--ratelimit` parameter to limit the backup rate. ## Does BR back up system tables? During data restoration, do they raise conflict? @@ -36,7 +36,7 @@ Running BR with root might fail due to the disk privilege, because the backup fi > **Note:** > -> You might encounter the same problem during data restoration. When reading the SST files for the first time, the reading privilege is verified. The execution duration of DDL suggests that there might be a long interval between checking the privilege and running BR. You might receive the error message `Permission denied` after waiting for a long time. +> You might encounter the same problem during data restoration. When the SST files are read for the first time, the reading privilege is verified. The execution duration of DDL suggests that there might be a long interval between checking the privilege and running BR. You might receive the error message `Permission denied` after waiting for a long time. > > Therefore, It is recommended to check the privilege before data restoration. @@ -46,12 +46,12 @@ Almost all of these problems are system call errors that occur when TiKV writes   For example, you might encounter the `Code: 22(invalid argument)` error when backing up data to the network disk built by `samba`. -## Where are the files backed up by BR stored when I use `local` storage? +## Where are the backed up files stored when I use `local` storage?   When you use `local` storage, `backupmeta` is generated on the node where BR is running, and backup files are generated on the Leader nodes of each Region. ## How about the size of the backup data? Are there replicas of the backup? -During data backup, backup files are generated on the Leader nodes of each Region. Therefore, the size of the backup is equal to the data size, with no redundant replicas. Therefore, the total data size is approximately the total number of TiKV data divided by the number of replicas. +During data backup, backup files are generated on the Leader nodes of each Region. The size of the backup is equal to the data size, with no redundant replicas. Therefore, the total data size is approximately the total number of TiKV data divided by the number of replicas. However, if you want to restore data locally, the number of replicas is equal to that of the TiKV nodes, because each TiKV must have access to all backup files. From 123cb2651521cef80d5662a07b92fc9e0775bcd9 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 15:32:32 +0800 Subject: [PATCH 03/10] address comment --- br/backup-and-restore-faq.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 873bdb4d055bc..15149b7332996 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -30,15 +30,15 @@ Because these system libraries do not exist in the backup files, no conflict occ ## What should I do to resolve the `Permission denied` error, even if I have tried to run BR using root in vain? -You need to confirm whether TiKV has access to the backup directory. To back up data, confirm whether TiKV has write privilege. To restore data, confirm whether it has read privilege. +You need to confirm whether TiKV has access to the backup directory. To back up data, confirm whether TiKV has the write permission. To restore data, confirm whether it has the read permission. -Running BR with root might fail due to the disk privilege, because the backup files (SST files) are saved by TiKV. +Running BR with root might fail due to the disk permission, because the backup files (SST files) are saved by TiKV. > **Note:** > -> You might encounter the same problem during data restoration. When the SST files are read for the first time, the reading privilege is verified. The execution duration of DDL suggests that there might be a long interval between checking the privilege and running BR. You might receive the error message `Permission denied` after waiting for a long time. +> You might encounter the same problem during data restoration. When the SST files are read for the first time, the read permission is verified. The execution duration of DDL suggests that there might be a long interval between checking the permission and running BR. You might receive the error message `Permission denied` after waiting for a long time. > -> Therefore, It is recommended to check the privilege before data restoration. +> Therefore, It is recommended to check the permission before data restoration. ## What should I do to resolve the `Io(Os...)` error? From f9ea193e765cfce10dec174c14d38aae632fa502 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 19:01:25 +0800 Subject: [PATCH 04/10] Update br/backup-and-restore-faq.md Co-authored-by: Ran --- br/backup-and-restore-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 15149b7332996..1e7a7620d2fbd 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -12,7 +12,7 @@ If the problems are not covered in this document and cannot be resolved, you can ## What should I do if the error message `could not read local://...:download sst failed` is returned during data restoration? -When restoring data, each node must have access to **all** backup files (SST files). By default, if `local` storage is used, you cannot restore data because the backup files are scattered among different nodes. Therefore, you have to copy the backup file of each TiKV node to the other TiKV nodes. +When you restore data, each node must have access to **all** backup files (SST files). By default, if `local` storage is used, you cannot restore data because the backup files are scattered among different nodes. Therefore, you have to copy the backup file of each TiKV node to the other TiKV nodes. It is recommended to mount an NFS disk as a backup disk during backup. For details, see [Back up a single table to a network disk](/br/backup-and-restore-use-cases.md#back-up-a-single-table-to-a-network-disk-recommended). From 6966619727e91765a34e85e70cf985adda1e500a Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 19:01:36 +0800 Subject: [PATCH 05/10] Update br/backup-and-restore-faq.md Co-authored-by: Ran --- br/backup-and-restore-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 1e7a7620d2fbd..987c303151d49 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -6,7 +6,7 @@ category: FAQ # Backup & Restore FAQ -This document lists the Frequently Asked Questions (FAQ) and the solutions about Backup & Restore (BR). +This document lists the frequently asked questions (FAQs) and the solutions about Backup & Restore (BR). If the problems are not covered in this document and cannot be resolved, you can raise questions in the [AskTUG](http://asktug.com) community. From 60a6921d884462715afd79df0cae69b03a8a4659 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 20:25:50 +0800 Subject: [PATCH 06/10] Update br/backup-and-restore-faq.md Co-authored-by: Ran --- br/backup-and-restore-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 987c303151d49..6dafdcb8710af 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -32,7 +32,7 @@ Because these system libraries do not exist in the backup files, no conflict occ You need to confirm whether TiKV has access to the backup directory. To back up data, confirm whether TiKV has the write permission. To restore data, confirm whether it has the read permission. -Running BR with root might fail due to the disk permission, because the backup files (SST files) are saved by TiKV. +Running BR with the root access might fail due to the disk permission, because the backup files (SST files) are saved by TiKV. > **Note:** > From 8cb8f24897e513b0ffd3b7150102dfe2abafae28 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 20:26:03 +0800 Subject: [PATCH 07/10] Update br/backup-and-restore-faq.md Co-authored-by: Ran --- br/backup-and-restore-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 6dafdcb8710af..5547b149764bd 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -54,4 +54,4 @@ When you use `local` storage, `backupmeta` is generated on the node where BR is During data backup, backup files are generated on the Leader nodes of each Region. The size of the backup is equal to the data size, with no redundant replicas. Therefore, the total data size is approximately the total number of TiKV data divided by the number of replicas. -However, if you want to restore data locally, the number of replicas is equal to that of the TiKV nodes, because each TiKV must have access to all backup files. +However, if you want to restore data from local storage, the number of replicas is equal to that of the TiKV nodes, because each TiKV must have access to all backup files. From 30a93e3e9aac569cd6fe78365438a5d424c8f645 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 21:21:23 +0800 Subject: [PATCH 08/10] remove a link --- br/backup-and-restore-faq.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 5547b149764bd..3703ac0733913 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -8,8 +8,6 @@ category: FAQ This document lists the frequently asked questions (FAQs) and the solutions about Backup & Restore (BR). -If the problems are not covered in this document and cannot be resolved, you can raise questions in the [AskTUG](http://asktug.com) community. - ## What should I do if the error message `could not read local://...:download sst failed` is returned during data restoration? When you restore data, each node must have access to **all** backup files (SST files). By default, if `local` storage is used, you cannot restore data because the backup files are scattered among different nodes. Therefore, you have to copy the backup file of each TiKV node to the other TiKV nodes. From bf1091d34b54dfad146ad7716dc3885c7b0feca8 Mon Sep 17 00:00:00 2001 From: toutdesuite Date: Fri, 5 Jun 2020 21:29:56 +0800 Subject: [PATCH 09/10] Update TOC.md --- TOC.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TOC.md b/TOC.md index 25fe95cf9d3ad..d3d8715f71ea9 100644 --- a/TOC.md +++ b/TOC.md @@ -89,10 +89,11 @@ - [Common TiUP Operations](/maintain-tidb-using-tiup.md) - [Common Ansible Operations](/maintain-tidb-using-ansible.md) + Backup and Restore - - [Use Mydumper and TiDB Lightning](/backup-and-restore-using-mydumper-lightning.md) - [Use BR](/br/backup-and-restore-tool.md) - [BR Usage Scenarios](/br/backup-and-restore-use-cases.md) - [BR storages](/br/backup-and-restore-storages.md) + - [BR FAQ](/br/backup-and-restore-faq.md) + - [Use Mydumper and TiDB Lightning](/backup-and-restore-using-mydumper-lightning.md) + Identify Abnormal Queries - [Identify Slow Queries](/identify-slow-queries.md) - [Identify Expensive Queries](/identify-expensive-queries.md) From 5024821e35c96df841b73624675900ad8ffdfb4c Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 5 Jun 2020 21:40:32 +0800 Subject: [PATCH 10/10] Update TOC.md --- TOC.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/TOC.md b/TOC.md index d3d8715f71ea9..cdc3c93c8f9b1 100644 --- a/TOC.md +++ b/TOC.md @@ -89,11 +89,10 @@ - [Common TiUP Operations](/maintain-tidb-using-tiup.md) - [Common Ansible Operations](/maintain-tidb-using-ansible.md) + Backup and Restore - - [Use BR](/br/backup-and-restore-tool.md) - - [BR Usage Scenarios](/br/backup-and-restore-use-cases.md) - - [BR storages](/br/backup-and-restore-storages.md) - - [BR FAQ](/br/backup-and-restore-faq.md) - [Use Mydumper and TiDB Lightning](/backup-and-restore-using-mydumper-lightning.md) + + Use BR + - [Use BR](/br/backup-and-restore-tool.md) + - [BR Use Cases](/br/backup-and-restore-use-cases.md) + Identify Abnormal Queries - [Identify Slow Queries](/identify-slow-queries.md) - [Identify Expensive Queries](/identify-expensive-queries.md) @@ -367,6 +366,12 @@ - [FAQ](/tidb-binlog/tidb-binlog-faq.md) + Tools - [Tools User Guide](/ecosystem-tool-user-guide.md) + - [Download](/download-ecosystem-tools.md) + + Backup & Restore (BR) + - [Use BR](/br/backup-and-restore-tool.md) + - [BR Use Cases](/br/backup-and-restore-use-cases.md) + - [BR storages](/br/backup-and-restore-storages.md) + - [BR FAQ](/br/backup-and-restore-faq.md) - [Mydumper](/mydumper-overview.md) - [Syncer](/syncer-overview.md) - [Loader](/loader-overview.md) @@ -408,7 +413,6 @@ - [PD Recover](/pd-recover.md) - [TiKV Control](/tikv-control.md) - [TiDB Control](/tidb-control.md) - - [Download](/download-ecosystem-tools.md) - [TiDB in Kubernetes](https://pingcap.com/docs/tidb-in-kubernetes/stable/) + FAQs - [TiDB FAQs](/faq/tidb-faq.md)