From 0f3ca57a6a757bd21ede50a12fc7eb6366eb6c98 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Wed, 23 Jun 2021 15:46:30 +0800 Subject: [PATCH 01/14] add command to check tikv user --- br/backup-and-restore-faq.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 348f1668ea5b..11192b909ba9 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -44,6 +44,24 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] > > 因此,最好在恢复前提前检查权限。 +如何检查权限: + +1.使用Linux原生进程查询命令: + +{{< copyable "shell-regular" >}} + +```bash +ps aux | grep tikv +``` + +2.使用tiup命令查询集群启动信息: + +{{< copyable "shell-regular" >}} + +```bash +tiup cluster list +``` + ## BR 遇到错误信息 `Io(Os...)`,该如何处理? 这类问题几乎都是 TiKV 在写盘的时候遇到的系统调用错误。例如遇到 `Io(Os { code: 13, kind: PermissionDenied...})` 或者 `Io(Os { code: 2, kind: NotFound...})` 这类错误信息,首先检查备份目录的挂载方式和文件系统,试试看备份到其它文件夹或者其它硬盘。 From 835ddbe03847e8080eb4dabdaead49961ec5b034 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Wed, 23 Jun 2021 16:16:31 +0800 Subject: [PATCH 02/14] fix comment from teammate --- 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 11192b909ba9..70d990d5a6cb 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -51,7 +51,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] {{< copyable "shell-regular" >}} ```bash -ps aux | grep tikv +ps aux | grep tikv-server ``` 2.使用tiup命令查询集群启动信息: From 38b294cb2706b803c5abd0c40932988da168b492 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 08:58:06 +0800 Subject: [PATCH 03/14] update details for elaborating the user case. --- br/backup-and-restore-faq.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 70d990d5a6cb..34555dcd0aa9 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -52,6 +52,18 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] ```bash ps aux | grep tikv-server +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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log +``` + +或者 + +{{< copyable "shell-regular" >}} + +```bash +ps aux | grep tikv-server | awk '{print $1}' +tidb_ouo +tidb_ouo ``` 2.使用tiup命令查询集群启动信息: @@ -60,8 +72,27 @@ ps aux | grep tikv-server ```bash tiup cluster list +[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 +``` + +检查备份目录权限,如:backup目录是备份数据存储目录 + +{{< copyable "shell-regular" >}} + +```bash +[root@Copy-of-VM-EE-CentOS76-v1 fengou1]# 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 .. ``` +tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 + + ## BR 遇到错误信息 `Io(Os...)`,该如何处理? 这类问题几乎都是 TiKV 在写盘的时候遇到的系统调用错误。例如遇到 `Io(Os { code: 13, kind: PermissionDenied...})` 或者 `Io(Os { code: 2, kind: NotFound...})` 这类错误信息,首先检查备份目录的挂载方式和文件系统,试试看备份到其它文件夹或者其它硬盘。 From faaf02ecdbe6b099db6ea246988d1a4bfc31c8ea Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 09:07:29 +0800 Subject: [PATCH 04/14] reprase case --- br/backup-and-restore-faq.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 34555dcd0aa9..98b823567d60 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -52,9 +52,10 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] ```bash ps aux | grep tikv-server +``` +命令输出示例: 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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log -``` 或者 @@ -62,9 +63,10 @@ tidb_ouo 9236 9.8 3.8 2048940 631136 ? Ssl 08:28 1:05 bin/tikv-server ```bash ps aux | grep tikv-server | awk '{print $1}' +``` +命令输出示例: tidb_ouo tidb_ouo -``` 2.使用tiup命令查询集群启动信息: @@ -72,26 +74,30 @@ tidb_ouo ```bash tiup cluster list +``` +命令输出示例: [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 -``` + 检查备份目录权限,如:backup目录是备份数据存储目录 {{< copyable "shell-regular" >}} ```bash +ls -al backup +``` +命令输出示例: [root@Copy-of-VM-EE-CentOS76-v1 fengou1]# 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 .. -``` -tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 +tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 ## BR 遇到错误信息 `Io(Os...)`,该如何处理? From 58d4b3d59e334e47cbf4b30d34d4c6f707932a84 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 09:10:09 +0800 Subject: [PATCH 05/14] fix lint error --- br/backup-and-restore-faq.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 98b823567d60..013e9b2898dd 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -53,6 +53,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] ```bash ps aux | grep tikv-server ``` + 命令输出示例: 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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log @@ -64,6 +65,7 @@ tidb_ouo 9236 9.8 3.8 2048940 631136 ? Ssl 08:28 1:05 bin/tikv-server ```bash ps aux | grep tikv-server | awk '{print $1}' ``` + 命令输出示例: tidb_ouo tidb_ouo @@ -75,6 +77,7 @@ tidb_ouo ```bash tiup cluster list ``` + 命令输出示例: [root@Copy-of-VM-EE-CentOS76-v1 br]# tiup cluster list Starting component `cluster`: /root/.tiup/components/cluster/v1.5.2/tiup-cluster list @@ -82,7 +85,6 @@ Name User Version Path ---- ---- ------- ---- ---------- tidb_cluster tidb_ouo v5.0.2 /root/.tiup/storage/cluster/clusters/tidb_cluster /root/.tiup/storage/cluster/clusters/tidb_cluster/ssh/id_rsa - 检查备份目录权限,如:backup目录是备份数据存储目录 {{< copyable "shell-regular" >}} @@ -90,13 +92,13 @@ tidb_cluster tidb_ouo v5.0.2 /root/.tiup/storage/cluster/clusters/tidb_clust ```bash ls -al backup ``` + 命令输出示例: [root@Copy-of-VM-EE-CentOS76-v1 fengou1]# 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 .. - tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 ## BR 遇到错误信息 `Io(Os...)`,该如何处理? From 7f843a0930b989232faf3c92430be1eb6e112272 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 09:22:27 +0800 Subject: [PATCH 06/14] lint error --- br/backup-and-restore-faq.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 013e9b2898dd..4536e5821965 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -55,8 +55,10 @@ ps aux | grep tikv-server ``` 命令输出示例: +``` 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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log +``` 或者 @@ -67,8 +69,10 @@ ps aux | grep tikv-server | awk '{print $1}' ``` 命令输出示例: +``` tidb_ouo tidb_ouo +``` 2.使用tiup命令查询集群启动信息: @@ -79,11 +83,13 @@ tiup cluster list ``` 命令输出示例: +``` [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 +``` 检查备份目录权限,如:backup目录是备份数据存储目录 @@ -94,10 +100,12 @@ ls -al backup ``` 命令输出示例: +``` [root@Copy-of-VM-EE-CentOS76-v1 fengou1]# 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 .. +``` tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 From 499f0709606d9f6046e72c6c94957a52caa2bd38 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 09:29:29 +0800 Subject: [PATCH 07/14] lint error --- br/backup-and-restore-faq.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 4536e5821965..fd25ca1228a0 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -55,7 +55,8 @@ ps aux | grep tikv-server ``` 命令输出示例: -``` + +```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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log ``` @@ -69,7 +70,8 @@ ps aux | grep tikv-server | awk '{print $1}' ``` 命令输出示例: -``` + +```shell tidb_ouo tidb_ouo ``` @@ -83,7 +85,8 @@ tiup cluster list ``` 命令输出示例: -``` + +```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 @@ -100,7 +103,8 @@ ls -al backup ``` 命令输出示例: -``` + +```shell [root@Copy-of-VM-EE-CentOS76-v1 fengou1]# ls -al backup total 0 drwxr-xr-x 2 root root 6 Jun 28 17:48 . From 6cd0fbc1a6206fbe7df06af99a73f49cbd74cd58 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Tue, 6 Jul 2021 10:22:55 +0800 Subject: [PATCH 08/14] remove read --- 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 fd25ca1228a0..2320b1236e0b 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -111,7 +111,7 @@ drwxr-xr-x 2 root root 6 Jun 28 17:48 . drwxr-xr-x 11 root root 310 Jul 4 10:35 .. ``` -tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限读写backup目录, 故备份失败。 +tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限写backup目录, 故备份失败。 ## BR 遇到错误信息 `Io(Os...)`,该如何处理? From dd8eb34aea02a281377ca04d822c9470bb18f872 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Thu, 8 Jul 2021 08:28:52 +0800 Subject: [PATCH 09/14] rephrase the info, modified user info --- br/backup-and-restore-faq.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 2320b1236e0b..57ceca810512 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -46,7 +46,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] 如何检查权限: -1.使用Linux原生进程查询命令: +1. 执行 Linux 原生的进程查询命令: {{< copyable "shell-regular" >}} @@ -54,14 +54,14 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] ps aux | grep tikv-server ``` -命令输出示例: +命令输出示例如下: ```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/fengou1/tidb-data/tikv-20162 --config conf/tikv.toml --log-file /home/fengou1/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/fengou1/tidb-data/tikv-20161 --config conf/tikv.toml --log-file /home/fengou1/tidb-deploy/tikv-20161/log/tikv.log +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 ``` -或者 +或者执行以下命令: {{< copyable "shell-regular" >}} @@ -69,14 +69,14 @@ tidb_ouo 9236 9.8 3.8 2048940 631136 ? Ssl 08:28 1:05 bin/tikv-server ps aux | grep tikv-server | awk '{print $1}' ``` -命令输出示例: +命令输出示例如下: ```shell tidb_ouo tidb_ouo ``` -2.使用tiup命令查询集群启动信息: +2. 使用 TiUP 命令查询集群的启动信息: {{< copyable "shell-regular" >}} @@ -84,7 +84,7 @@ tidb_ouo tiup cluster list ``` -命令输出示例: +命令输出示例如下: ```shell [root@Copy-of-VM-EE-CentOS76-v1 br]# tiup cluster list @@ -94,7 +94,7 @@ Name User Version Path tidb_cluster tidb_ouo v5.0.2 /root/.tiup/storage/cluster/clusters/tidb_cluster /root/.tiup/storage/cluster/clusters/tidb_cluster/ssh/id_rsa ``` -检查备份目录权限,如:backup目录是备份数据存储目录 +3. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: {{< copyable "shell-regular" >}} @@ -102,16 +102,16 @@ tidb_cluster tidb_ouo v5.0.2 /root/.tiup/storage/cluster/clusters/tidb_clust ls -al backup ``` -命令输出示例: +命令输出示例如下: ```shell -[root@Copy-of-VM-EE-CentOS76-v1 fengou1]# ls -al backup +[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 .. ``` -tikv-server为用户tidb_ouo启动,用户账号tidb_ouo没有权限写backup目录, 故备份失败。 +由以上命令输出结果可知,`tikv-server` 实例由用户 `tidb_ouo` 启动,但用户账号 `tidb_ouo` 没有 `backup` 目录的写入权限, 所以备份失败。 ## BR 遇到错误信息 `Io(Os...)`,该如何处理? From 44dc6f1a92b4cc53e35e85cd21b518f1c72e8aae Mon Sep 17 00:00:00 2001 From: fengou1 Date: Thu, 8 Jul 2021 08:38:56 +0800 Subject: [PATCH 10/14] linter error --- br/backup-and-restore-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 57ceca810512..a54debc6a063 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -76,7 +76,7 @@ tidb_ouo tidb_ouo ``` -2. 使用 TiUP 命令查询集群的启动信息: +2. 使用 TiUP 命令查询集群的启动信息: {{< copyable "shell-regular" >}} @@ -94,7 +94,7 @@ Name User Version Path 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. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: +3. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: {{< copyable "shell-regular" >}} From bdec7d5366ef4d562fdcf5aa4e52286892a615e5 Mon Sep 17 00:00:00 2001 From: fengou1 Date: Thu, 8 Jul 2021 08:43:23 +0800 Subject: [PATCH 11/14] fix lint error --- br/backup-and-restore-faq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index a54debc6a063..1eda37f66316 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -46,7 +46,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] 如何检查权限: -1. 执行 Linux 原生的进程查询命令: +### 1. 执行 Linux 原生的进程查询命令: {{< copyable "shell-regular" >}} @@ -76,7 +76,7 @@ tidb_ouo tidb_ouo ``` -2. 使用 TiUP 命令查询集群的启动信息: +### 2. 使用 TiUP 命令查询集群的启动信息: {{< copyable "shell-regular" >}} @@ -94,7 +94,7 @@ Name User Version Path 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. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: +### 3. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: {{< copyable "shell-regular" >}} From fcf7b06a96b871127e20234ed19a776d9978548c Mon Sep 17 00:00:00 2001 From: fengou1 Date: Thu, 8 Jul 2021 08:46:30 +0800 Subject: [PATCH 12/14] fix lint error Trailing punctuation in heading --- br/backup-and-restore-faq.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 1eda37f66316..c8a29a29c3c6 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -46,7 +46,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] 如何检查权限: -### 1. 执行 Linux 原生的进程查询命令: +### 1. 执行 Linux 原生的进程查询命令 {{< copyable "shell-regular" >}} @@ -76,7 +76,7 @@ tidb_ouo tidb_ouo ``` -### 2. 使用 TiUP 命令查询集群的启动信息: +### 2. 使用 TiUP 命令查询集群的启动信息 {{< copyable "shell-regular" >}} @@ -94,7 +94,7 @@ Name User Version Path 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. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: +### 3. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下 {{< copyable "shell-regular" >}} From 997429c7395a13bb4dfcc353afd40b266b6b4476 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 8 Jul 2021 10:04:59 +0800 Subject: [PATCH 13/14] Update br/backup-and-restore-faq.md --- br/backup-and-restore-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index c8a29a29c3c6..7e0c483940a9 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -44,7 +44,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] > > 因此,最好在恢复前提前检查权限。 -如何检查权限: +你可以按照如下步骤进行权限检查: ### 1. 执行 Linux 原生的进程查询命令 @@ -169,4 +169,4 @@ BR 不会备份统计信息(v4.0.9 除外)。所以在恢复存档后需要 BR v4.0.9 备份统计信息使 BR 消耗过多内存,为保证备份过程正常,从 v4.0.10 开始默认关闭备份统计信息的功能。 -如果不对表执行 `ANALYZE`,TiDB 会因统计信息不准确而选不中最优化的执行计划。如果查询性能不是重点关注项,可以忽略 `ANALYZE`。 \ No newline at end of file +如果不对表执行 `ANALYZE`,TiDB 会因统计信息不准确而选不中最优化的执行计划。如果查询性能不是重点关注项,可以忽略 `ANALYZE`。 From 367ff780c0f95af2b51e2409b2452af463c654a5 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 8 Jul 2021 10:12:34 +0800 Subject: [PATCH 14/14] improve the format --- br/backup-and-restore-faq.md | 132 +++++++++++++++++------------------ 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/br/backup-and-restore-faq.md b/br/backup-and-restore-faq.md index 7e0c483940a9..6f82baf5876d 100644 --- a/br/backup-and-restore-faq.md +++ b/br/backup-and-restore-faq.md @@ -46,72 +46,72 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-faq/'] 你可以按照如下步骤进行权限检查: -### 1. 执行 Linux 原生的进程查询命令 - -{{< copyable "shell-regular" >}} - -```bash -ps aux | grep tikv-server -``` - -命令输出示例如下: - -```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 -``` - -或者执行以下命令: - -{{< copyable "shell-regular" >}} - -```bash -ps aux | grep tikv-server | awk '{print $1}' -``` - -命令输出示例如下: - -```shell -tidb_ouo -tidb_ouo -``` - -### 2. 使用 TiUP 命令查询集群的启动信息 - -{{< copyable "shell-regular" >}} - -```bash -tiup cluster list -``` - -命令输出示例如下: - -```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. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下 - -{{< copyable "shell-regular" >}} - -```bash -ls -al backup -``` - -命令输出示例如下: - -```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 .. -``` - -由以上命令输出结果可知,`tikv-server` 实例由用户 `tidb_ouo` 启动,但用户账号 `tidb_ouo` 没有 `backup` 目录的写入权限, 所以备份失败。 +1. 执行 Linux 原生的进程查询命令 + + {{< copyable "shell-regular" >}} + + ```bash + ps aux | grep tikv-server + ``` + + 命令输出示例如下: + + ```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 + ``` + + 或者执行以下命令: + + {{< copyable "shell-regular" >}} + + ```bash + ps aux | grep tikv-server | awk '{print $1}' + ``` + + 命令输出示例如下: + + ```shell + tidb_ouo + tidb_ouo + ``` + +2. 使用 TiUP 命令查询集群的启动信息 + + {{< copyable "shell-regular" >}} + + ```bash + tiup cluster list + ``` + + 命令输出示例如下: + + ```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. 检查备份目录的权限,例如 `backup` 目录是备份数据存储目录。命令示例如下: + + {{< copyable "shell-regular" >}} + + ```bash + ls -al backup + ``` + + 命令输出示例如下: + + ```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 .. + ``` + + 由以上命令输出结果可知,`tikv-server` 实例由用户 `tidb_ouo` 启动,但用户账号 `tidb_ouo` 没有 `backup` 目录的写入权限, 所以备份失败。 ## BR 遇到错误信息 `Io(Os...)`,该如何处理?