使用BR备份单表数据失败

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】
V5.0.1

【问题描述】
使用BR备份了数据库中的某个表:
`./br backup table \

--pd "10.6.142.160:2379" \
--db demo_21_ceshi \
--table pr_budget \
--storage "local:///home/tidb/backup" \
--ratelimit 120 \
--log-file backuptable2.log

Detail BR log in backuptable2.log
Table backup <-----------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
Checksum <---------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/05/12 16:31:22.479 +08:00] [INFO] [collector.go:62] [“Table backup success summary”] [total-ranges=2] [ranges-succeed=2] [ranges-failed=0] [backup-checksum=5.618197ms] [backup-fast-checksum=294.581µs] [backup-total-regions=2] [BackupTS=424885166378582018] [Size=6447] [total-take=83.163713ms] [data-size=108B] [average-speed=5.433kB/s] [total-kv=2]
`

提示备份成功,但是在TiKV的备份目录下没有发现备份文件。

日志文件是:backuptable2.log (19.4 KB)

使用下面命令恢复的时候报找不到SST文件:
`
./br restore table \

--pd "10.6.142.160:2379" \
--db "demo_21_ceshi" \
--table "pr_budget" \
--storage "local:///home/tidb/backup" \
--log-file restoretable2.log

Detail BR log in restoretable2.log
Table restore <----------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
Error: Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/25a0ea1f-a1dd-40b0-8896-7d079b86381f_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/37ba403b-f78e-48dd-bcff-16561ee5d171_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/de637e76-1dcc-41ee-8bac-9a457bff9364_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/ba5e3963-ae48-41e5-ad9a-b83fd716c753_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/d36e8ae3-889a-427b-a53f-54b9187fa9ed_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/25fe7398-f242-4409-a062-ce19c80eca21_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/b6bbeb4c-9049-436b-9c06-ebc32f358927_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed; Cannot read local:///home/tidb/backup/4_39588_8505_d38cf6fde13a05f5b64a299b27c18e4e41bb524187a1583f410c1ffebdabb983_1620808282471_write.sst into /tidb-data/tikv-20160/import/.temp/1abb96c3-b5f7-41d1-b3f8-f68fa88a5bd3_42385_17_8510_write.sst: No such file or directory (os error 2): [BR:KV:ErrKVDownloadFailed]download sst failed
`


Hello~ 从报错看是没有识别到目录,可以确认一下目录权限是否正确。官方文档里面怼这块有一个 FAQ 的介绍,可以参考一下。

https://docs.pingcap.com/zh/tidb/stable/backup-and-restore-faq#backup--restore-常见问题

备份目录应该是没问题,我备份整个库是有sst文件输出的,库里面的单个表就不行

你看一下 log 中的 info 信息,是不是已经有重复的文件或者位置重复,没有办法覆盖,可能就备份不成功。

@hey-hoho 请确认一下,你这边是否将所有 TiKV 节点上的备份文件聚合在一起。可以参照这个例子的前置要求。 目前备份到本地磁盘比较麻烦,推荐备份到使用 S3 协议的远段存储

https://docs.pingcap.com/zh/tidb/stable/backup-and-restore-use-cases#从本地磁盘恢复备份数据推荐测试环境试用

@zwj-coder 这个报错的 log 不能直接诊断具体的问题原因,建议改善一下。能够显示 which tikv 缺少了什么文件或者目录

备份文件是聚合在一起的,应该是指定的目录有问题,换新的目录就可以了

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。