使用 TiUP 部署 TiDB 集群-报错no gcp_rsa

执行部署命令-报错:open /home/ping/.ssh/gcp_rsa: no such file or directory

[ping@ptidb ~]$ tiup cluster deploy tidb-test v4.0.0-rc ./topology.yaml --user ping -i /home/ping/.ssh/gcp_rsa
Starting component `cluster`: /home/ping/.tiup/components/cluster/v0.4.8/cluster deploy tidb-test v4.0.0-rc ./topology.yaml --user ping -i /home/ping/.ssh/gcp_rsa
Please confirm your topology:
TiDB Cluster: tidb-test
TiDB Version: v4.0.0-rc
Type          Host         Ports                            Directories
----          ----         -----                            -----------
pd            10.xx.xx.36  2379/2380                        /tidb-deploy/pd-2379,/tidb-data/pd-2379
tikv          10.xx.xx.32  20160/20180                      /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv          10.xx.xx.34  20160/20180                      /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv          10.xx.xx.35  20160/20180                      /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tidb          10.xx.xx.41  4000/10080                       /tidb-deploy/tidb-4000
tiflash       10.xx.xx.41  9000/8123/3930/20170/20292/8234  /tidb-deploy/tiflash-9000,/tidb-data/tiflash-9000
prometheus    10.xx.xx.36  9090                             /tidb-deploy/prometheus-9090,/tidb-data/prometheus-9090
grafana       10.xx.xx.36  3000                             /tidb-deploy/grafana-3000
alertmanager  10.xx.xx.36  9093/9094                        /tidb-deploy/alertmanager-9093,/tidb-data/alertmanager-9093
Attention:
    1. If the topology is not what you expected, check your yaml file.
    1. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]:  y

Error: Failed to read SSH identity file '/home/ping/.ssh/gcp_rsa' (cliutil.id_read_failed)
  caused by: open /home/ping/.ssh/gcp_rsa: no such file or directory

Please check whether your SSH identity file /home/ping/.ssh/gcp_rsa exists and have access permission.
Success to stop component `cluster`
Error: start `/home/ping/.tiup/components/cluster/v0.4.8/cluster` (wd:/home/ping/.tiup/data/Rw8pEWO) failed: exit status 1

[ping@ptidb ~]$ cd /home/ping/.ssh/
[ping@ptidb .ssh]$ ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts



问题1:

我本机没有 /home/ping/.ssh/目录下没有gcp_rsa,这个文件是tiup自动产生的,还是需要配置,如果要, 是怎样配置出来的呢?

问题2:

我用的是sudo 权限的用户名为ping的账号, topology.yaml 文件中已经 user: “tidb” 改成了 user: “ping”, 是否一定需要用tidb这个名称的账号呢?

你好,

-i 使用的是 --user 的公钥,所以对应到你的环境就是 id_rsa

可以用其他有 ssh 和 sudo 权限的用户完成部署

所以可以尝试使用命令:tiup cluster deploy tidb-test v4.0.0-rc ./topology.yaml --user ping -i /home/ping/.ssh/id_rsa 进行部署

1赞

谢谢啊!

执行: tiup cluster deploy tidb-test v4.0.0-rc ./topology.yaml --user ping -i /home/ping/.ssh/id_rsa

报错如下:

Do you want to continue? [y/N]:  y

Error: Failed to read SSH identity file '/home/ping/.ssh/id_rsa.pub' (cliutil.id_read_failed)
  caused by: ssh: no key found

Looks like your SSH private key /home/ping/.ssh/id_rsa.pub is invalid.
Success to stop component `cluster`
Error: start `/home/ping/.tiup/components/cluster/v0.4.8/cluster` (wd:/home/ping/.tiup/data/Rw95Oga) failed: exit status 1

最后是这条语句, tiup cluster deploy tidb-test v4.0.0-rc ./topology.yaml 然后在提示下,手动输入密码通过了

你好,

:+1:,–user 默认为 root,如果环境满足可以使用该形式部署~

–user 在集群服务器是否为免密互信,因为需要使用该用户登录对方服务器创建用户和目录等操作