pingcap / tiup

A component manager for TiDB
https://tiup.io
Apache License 2.0
427 stars 313 forks source link

After tmp-storage-path is set, the error permission denied is returned #2328

Open together-wang opened 11 months ago

together-wang commented 11 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

when deploy tidb cluster and set tmp-storage-path, tidb deploy success but start faild because of permission denied.

tiup cluster deploy lwt v6.5.5 ./test.yaml -utidb(user_a)

global:
 user: "tidb"(user_b)
 ssh_port: 22
 deploy_dir: "/DATA/disk1/tidb-deploy"
 data_dir: "/DATA/disk1/tidb-data"
tidb_servers:
 - host: xxx
   port: 13309
   status_port: 10030
   deploy_dir: /DATA/disk1/tidb-deploy/tidb-13309
   log_dir: /DATA/disk1/tidb-deploy/tidb-13309/log
   config:
     tmp-storage-path: /DATA/disk1/lwtmp

deploy_user "tidb" has sudo permissions and can successfully create a directory but user_b(tidb) mkdir failed. and sudo user_b(tidb) mkdir success.

[tidb@172-16-120-12 ~]$ sudo mkdir /DATA/disk1/lwtmp
[tidb@172-16-120-12 ~]$ ssh -i /home/tidb/.tiup/storage/cluster/clusters/lwt/ssh/id_rsa [tidb@10.2.8.2](mailto:tidb@10.2.8.2) 'mkdir /DATA/disk1/lwtmp1'
mkdir: 无法创建目录"/DATA/disk1/lwtmp1": 权限不够
[tidb@172-16-120-12 ~]$

[tidb@172-16-120-12 config]$ ssh -i /home/tidb/.tiup/storage/cluster/clusters/lwt/ssh/id_rsa tidb@10.2.8.2 'sudo mkdir /DATA/disk1/lwtmp2'
[tidb@172-16-120-12 config]$
  1. What did you expect to see?

no error

  1. What did you see instead?

tiup cluster start tidb-server failed because of mkdir tmp-storage-path failed.

  1. What version of TiUP are you using (tiup --version)?

[tidb@172-16-120-12 config]$ tiup --version 1.13.0 v1.13.0-nightly-3 Go Version: go1.21.1 Git Ref: master GitHash: 9d1ba4b8357a1b34d02556cbd77236de1df1b1dc