TiUP cluster 在单机上模拟生产环境部署 报 task.env_init.failed

Error: Failed to initialize TiDB environment on remote host ‘10…233’ (task.env_init.failed)
caused by: Failed to create new system user ‘tidb’ on remote host
caused by: Failed to execute command over SSH for ‘appdeploy@10…233:22’
caused by: Process exited with status 1

ssh免密是可以登录的

麻烦参考此文档先检查下,多谢。

已经按这个方式赋权了,用免密登录报这个
Error: Failed to initialize TiDB environment on remote host ‘10…233’ (task.env_init.failed)
caused by: Failed to create new system user ‘tidb’ on remote host
caused by: Failed to execute command over SSH for ‘appdeploy@10…233:22’
caused by: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

用密码是报下面的错
Error: Failed to initialize TiDB environment on remote host ‘10…233’ (task.env_init.failed)
caused by: Failed to create new system user ‘tidb’ on remote host
caused by: Failed to execute command over SSH for ‘appdeploy@10…233:22’
caused by: Process exited with status 1

1.请问具体使用的哪个用户免密?免密是如何做的,如何确认免密没有问题?
2.部署的命令是什么?

是单机部署
tiup cluster deploy icss_tidb4 v4.0.1 ./topo.yaml --user appdeploy -p

直接在本机是可以登录的
[appdeploy@1zzzz ~]$ ssh 10…233
Last login: Mon Jul 20 15:11:27 2020
WARNING: If you are not authorized to access this private computer system, disconnect now. All activities on this system will be monitored and recorded without prior notification or permission!
[appdeploy@1zzzz ~]$

可以提供下 debug 日志看下,
–user 需要在所有 tidb 节点免密互信,可以尝试在中控节点使用 ssh appdeploy@10…233 是否可以登陆,其他节点类似操作

在10.****.233 执行 tiup cluster deploy icss_tidb4 v4.0.1 ./topo.yaml --user appdeploy -p

配置

global:
user: “tidb”
ssh_port: 22
deploy_dir: “/tidb-deploy”
data_dir: “/tidb-data”

# Monitored variables are applied to all the machines.

monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115

server_configs:
tidb:
log.slow-threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.enable-placement-rules: true
tiflash:
logger.level: “info”

pd_servers:

  • host: 10.*****.176

tidb_servers:

  • host: 10.*****.176

tikv_servers:

  • host: 10.*****.176
    port: 20160
    status_port: 20180

  • host: 10.*****.176
    port: 20161
    status_port: 20181

  • host: 10.*****.176
    port: 20162
    status_port: 20182

tiflash_servers:

  • host: 10.*****.176

monitoring_servers:

  • host: 10.*****.176

grafana_servers:

  • host: 10.*****.176

可以连接:
Error: Failed to initialize TiDB environment on remote host ‘10..176’ (task.env_init.failed)
caused by: Failed to create new system user ‘tidb’ on remote host
caused by: Failed to execute command over SSH for 'appdeploy@10.
.176:22’
caused by: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

Verbose debug logs has been written to /home/appdeploy/logs/tiup-cluster-debug-2020-07-20-20-58-18.log.
Error: run `` (wd:/home/appdeploy/.tiup/data/S5HlxYC) failed: exit status 1
[appdeploy@1a01vlb5951zzzz ~]$ ssh appdeploy@10.*****.176
Last login: Mon Jul 20 20:54:17 2020 from 10.****.233
WARNING: If you are not authorized to access this private computer system, disconnect now. All activities on this system will be monitored and recorded without prior notification or permission!
[appdeploy@1a01vlb5973zzzz ~]$

log:

Execute command finished {“code”: 1, “error”: “task.env_init.failed: Failed to initialize TiDB environment on remote host ‘10..176’, cause: module.user.user_add_failed: Failed to create new system user ‘tidb’ on remote host, cause: executor.ssh.execute_failed: Failed to execute command over SSH for 'appdeploy@10..176:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/usr/bin:/usr/sbin sudo -H -u root bash -c “id -u tidb > /dev/null 2>&1 || /usr/sbin/useradd -m -s /bin/bash tidb && echo ‘tidb ALL=(ALL) NOPASSWD:ALL’ > /etc/sudoers.d/tidb”}, cause: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain”, “errorVerbose”: “task.env_init.failed: Failed to initialize TiDB environment on remote host ‘10..176’, cause: module.user.user_add_failed: Failed to create new system user ‘tidb’ on remote host, cause: executor.ssh.execute_failed: Failed to execute command over SSH for 'appdeploy@10..176:22’ {ssh_stderr: , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/usr/bin:/usr/sbin sudo -H -u root bash -c “id -u tidb > /dev/null 2>&1 || /usr/sbin/useradd -m -s /bin/bash tidb && echo ‘tidb ALL=(ALL) NOPASSWD:ALL’ > /etc/sudoers.d/tidb”}, cause: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain\ at github.com/pingcap/tiup/pkg/cluster/executor.(*SSHExecutor).Execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/executor/ssh.go:156\ at github.com/pingcap/tiup/pkg/cluster/module.(*UserModule).Execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/module/user.go:114\ at github.com/pingcap/tiup/pkg/cluster/task.(*EnvInit).execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/task/env_init.go:63\ at github.com/pingcap/tiup/pkg/cluster/task.(*EnvInit).Execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/task/env_init.go:44\ at github.com/pingcap/tiup/pkg/cluster/task.(*Serial).Execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/task/task.go:189\ at github.com/pingcap/tiup/pkg/cluster/task.(*StepDisplay).Execute()\ \tgithub.com/pingcap/tiup@/pkg/cluster/task/step.go:85\ at github.com/pingcap/tiup/pkg/cluster/task.(*Parallel).Execute.func1()\ \tgithub.com/pingcap/tiup@/pkg/cluster/task/task.go:242\ at runtime.goexit()\ \truntime/asm_amd64.s:1357”}

请问命令里使用的appdeploy 是否有足够权限,能否尝试用 root 用户部署,多谢

系统默认root没ssh权限,问题已经解决了,是app这个账号没有sudo权限导致,加上sudo权限就好了。谢谢!

:wave::clap::clap:

我使用了root用户 也看到/etc/sudoers 文件中有sudo权限 但是还是报同样的错误,请大神指教tiup-cluster-debug-2020-10-29-10-25-52.log (26.0 KB)

辛苦整理下基本信息, 开新帖我们跟进下

安装tidb 用户创建失败 整理完毕,请大神指教!

收到~

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