nfs 共享文件夹已挂载至各TiKV节点的/tidbbak,已创建空文件夹 /tidbbak/fullbak。
备份命令如下:
br backup full --pd "192.168.3.221:2379" --storage "local://tidbbak/fullbak" --ratelimit 120 --log-file /tidbbak/fullbak/fullbackup_
date +%Y%m%d.log
报错信息如下(**额外吐槽一下,日志太长14万字:?眼睛快看瞎了,只截取最后的错误信息):
["Full Backup failed summary"] [total-ranges=86] [ranges-succeed=0] [ranges-failed=86] [backup-total-ranges=86] [backup-total-regions=102] [unit-name="range ......
此处省略 140000 字
(*Group).Go.func1\
\t/go/pkg/mod/golang.org/x/sync@v0.0.0-20220513210516-0976fa681c29/errgroup/errgroup.go:74\
runtime.goexit\
\t/usr/local/go/src/runtime/asm_amd64.s:1571"]
Error: error happen in store 1 at 192.168.3.225:20160: local:<path:"/fullbak" > File or directory not found on TiKV Node (store id: 1; Address: 192.168.3.225:20160). work around:please ensure br and tikv nodes share a same storage and the user of br and tikv has same uid.: [BR:KV:ErrKVStorage]tikv storage occur I/O error
通过如下脚本备份,则无报错
#!/bin/bash
export DATEDIR=`date +%Y%m%d`
export BASEDIR=/tidbbak
mkdir $BASEDIR/$DATEDIR
br backup full --pd "192.168.3.221:2379" --storage "local://$BASEDIR/$DATEDIR" --ratelimit 120 --log-file $BASEDIR/$DATEDIR/fullbackup_`date +%Y%m%d`.log