diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 414f02b21ff06..74d00d8ea9660 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -35,7 +35,74 @@ Running BR with the root access might fail due to the disk permission, because t > > 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. +> Therefore, it is recommended to check the permission before data restore according to the following steps: + +1. Run the Linux-native command for process query: + + {{< copyable "shell-regular" >}} + + ```bash + ps aux | grep tikv-server + ``` + + The output of the above command: + + ```shell + tidb_ouo 9235 10.9 3.8 2019248 622776 ? Ssl 08:28 1:12 bin/tikv-server --addr 0.0.0.0:20162 --advertise-addr 172.16.6.118:20162 --status-addr 0.0.0.0:20188 --advertise-status-addr 172.16.6.118:20188 --pd 172.16.6.118:2379 --data-dir /home/user1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/user1/tidb-deploy/tikv-20162/log/tikv.log + tidb_ouo 9236 9.8 3.8 2048940 631136 ? Ssl 08:28 1:05 bin/tikv-server --addr 0.0.0.0:20161 --advertise-addr 172.16.6.118:20161 --status-addr 0.0.0.0:20189 --advertise-status-addr 172.16.6.118:20189 --pd 172.16.6.118:2379 --data-dir /home/user1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/user1/tidb-deploy/tikv-20161/log/tikv.log + ``` + + Or you can run the following command: + + {{< copyable "shell-regular" >}} + + ```bash + ps aux | grep tikv-server | awk '{print $1}' + ``` + + The output of the above command: + + ```shell + tidb_ouo + tidb_ouo + ``` + +2. Query the startup information of the cluster using the TiUP command: + + {{< copyable "shell-regular" >}} + + ```bash + tiup cluster list + ``` + + The output of the above command: + + ```shell + [root@Copy-of-VM-EE-CentOS76-v1 br]# tiup cluster list + Starting component `cluster`: /root/.tiup/components/cluster/v1.5.2/tiup-cluster list + Name User Version Path PrivateKey + ---- ---- ------- ---- ---------- + tidb_cluster tidb_ouo v5.0.2 /root/.tiup/storage/cluster/clusters/tidb_cluster /root/.tiup/storage/cluster/clusters/tidb_cluster/ssh/id_rsa + ``` + +3. Check the permission for the backup directory. For example, `backup` is for backup data storage: + + {{< copyable "shell-regular" >}} + + ```bash + ls -al backup + ``` + + The output of the above command: + + ```shell + [root@Copy-of-VM-EE-CentOS76-v1 user1]# ls -al backup + total 0 + drwxr-xr-x 2 root root 6 Jun 28 17:48 . + drwxr-xr-x 11 root root 310 Jul 4 10:35 .. + ``` + + From the above output, you can find that the `tikv-server` instance is started by the user `tidb_ouo`. But the user `tidb_ouo` does not have the write permission for `backup`, the backup fails. ## What should I do to handle the `Io(Os...)` error?