ubuntu 20.04 执行集群部署命令报错

【 TiDB 使用环境】单机部署集群,学习使用。
参考官方单机模拟生产环境部署指导:
https://docs.pingcap.com/zh/tidb/stable/quick-start-with-tidb#Linux

【概述】sshd已配置,执行命令时抛出异常:
Starting component cluster: /home/justin/.tiup/components/cluster/v1.8.0/tiup-cluster deploy cluster-1 v5.2.3 ./topology.yaml --user root -p
Input SSH password:

  • Detect CPU Arch
    • Detecting node 127.0.0.1 … Error

Error: failed to fetch cpu arch: executor.ssh.execute_failed: Failed to execute command over SSH for ‘root@127.0.0.1:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin uname -m}, cause: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password publickey], no supported methods remain

Verbose debug logs has been written to /home/justin/.tiup/logs/tiup-cluster-debug-2021-12-09-18-55-26.log.
Error: run /home/justin/.tiup/components/cluster/v1.8.0/tiup-cluster (wd:/home/justin/.tiup/data/Sr5nWd8) failed: exit status 1

【背景】执行部署命令:
tiup cluster deploy cluster-1 v5.2.3 ./topology.yaml --user root -p

【现象】
【业务影响】不涉及
【TiDB 版本】v5.3.0

2 个赞

使用系统ssh吧

 --ssh system
2 个赞

怎么用, tiup命令没看到有这选项啊

2 个赞

没太明白,如果是要单机部署集群的话,建议用 tiup playground,如果是要多台机器部署集群,建议用tiup cluster。ip建议写机器的ip,不要写127.0.0.1。
目前报错ssh互信有问题,建议删除掉自己配置的互信,用tiup部署的时候,会自动创建ssh互信的

1 个赞

就安装启动了sshd,什么都没配置,而且我本地可以ssh上。
不用127.0.0.1时 目前报错信息如下, 参考加粗部分,不知道这块要怎么配置
命令: tiup cluster deploy cluster-1 v5.3.0 ./topology.yaml --user justin -p


Starting component cluster: /home/justin/.tiup/components/cluster/v1.8.0/tiup-cluster deploy cluster-1 v5.3.0 ./topology.yaml --user justin -p
Input SSH password:

  • Detect CPU Arch
    • Detecting node 192.168.2.29 … Error

Error: failed to fetch cpu arch: executor.ssh.execute_failed: Failed to execute command over SSH for ‘justin@192.168.2.29:22’ {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c “uname -m”}, cause: Process exited with status 1

有使用tiup cluster check ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa] 先检查一下环境吗,方便把拓扑文件贴出来吗

check命令类似错误(见下面):tiup cluster check ./topology.yaml --user justin -p

拓扑文件:
topology.yaml (1.2 KB)


Starting component cluster: /home/justin/.tiup/components/cluster/v1.8.0/tiup-cluster check ./topology.yaml --user justin -p
Input SSH password:

  • Detect CPU Arch
    • Detecting node 192.168.2.29 … Error

Error: failed to fetch cpu arch: executor.ssh.execute_failed: Failed to execute command over SSH for ‘justin@192.168.2.29:22’ {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c “uname -m”}, cause: Process exited with status 1

再补充些上下文信息哈, 毕竟我才第一次接触tidb,不知道遗漏了什么

ssh可以正常登录:

justin@justin-KLVC-WXX9:~/workspace/tidb$ ssh justin@192.168.2.29
justin@192.168.2.29's password:
Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Fri Dec 10 15:26:34 2021 from 192.168.2.29
justin@justin-KLVC-WXX9:~$

本地.ssh目录:
justin@justin-KLVC-WXX9:~$ ll ~/.ssh
total 4
-rw-r–r-- 1 justin justin 666 12月 10 14:46 known_hosts

你检查一下,安装包的版本和cpu的类型是否是一致的,比如arm架构的cpu,要用arm版本的tidb安装包

cpu是x86_64, 从报错看应该还没到实际的安装那一步,连包都没开始下载, 在ssh建立连接阶段就报错了。。。

你们试过在ubuntu单机模拟生产集群部署成功过么, playground是没问题的。

主要是如下错误信息:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

直接加在后面就好

试了一样报错。

我刚刚测试了一下,你试试这样操作,修改配置
vim /etc/ssh/sshd_config
注释这一行 PermitRootLogin prohibit-password
添加一行 PermitRootLogin yes
重启ssh服务
/etc/init.d/ssh restart

然后去部署就行了

1 个赞

@bobbyz007 请问问题先解决了嘛 ?

1 个赞

不好意思忘记回复了,加这个配置可以了,多谢两位! @caiyfc

建议把这个配置补充到快速上手指南文档中,毕竟还是有人想在本地部署一个类生产的环境,方便学习定位问题。

感谢反馈~

可行的 试过了
vim /etc/ssh/sshd_config
注释这一行 PermitRootLogin prohibit-password
添加一行 PermitRootLogin yes
重启ssh服务
/etc/init.d/ssh restart

然后去部署就行了

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。