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

BR: Add backup-and-restore-faq.md (#2686) #2714

Merged
merged 3 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@
- [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)
+ 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)
Expand Down Expand Up @@ -330,6 +331,11 @@
- [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 FAQ](/br/backup-and-restore-faq.md)
- [Mydumper](/mydumper-overview.md)
- [Syncer](/syncer-overview.md)
- [Loader](/loader-overview.md)
Expand All @@ -356,7 +362,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)
Expand Down
55 changes: 55 additions & 0 deletions br/backup-and-restore-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
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 (FAQs) and the solutions about Backup & Restore (BR).

## 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.

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 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 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?

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 the write permission. To restore data, confirm whether it has the read permission.

Running BR with the root access 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 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 permission 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 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. 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 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.