我在扩容TiFlash时,报错

【 TiDB 使用环境】测试/
【 TiDB 版本】V8.5.1
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】扩容TiFlash时出错
【资源配置】进入到 TiDB Dashboard -集群信息 (Cluster Info) -主机(Hosts) 截图此页面
【scale-out-tiflash.yaml】
tiflash_servers:

  • host: 192.169.10.119

【扩容命令】tiup cluster scale-out tidb-test scale-out-tiflash.yaml --user root -i /root/.ssh/id_ed25519

我的root用户做了互信,tidb用户没做,是否tidb用户也要做互信??

【复制黏贴 ERROR 报错的日志】
2025-02-21T09:38:28.323+0800 INFO Execute command finished {“code”: 1, “error”: “failed to enable/disable tiflash: failed to enable: 192.169.10.119 tiflash-9000.service, please check the instance’s log(/tidb-deploy/tiflash-9000/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.169.10.119:22’ {ssh_stderr: Failed to enable unit: Unit file tiflash-9000.service does not exist.\n, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c "systemctl daemon-reload && systemctl enable tiflash-9000.service"}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.169.10.119:22’ {ssh_stderr: Failed to enable unit: Unit file tiflash-9000.service does not exist.\n, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin; /usr/bin/sudo -H bash -c "systemctl daemon-reload && systemctl enable tiflash-9000.service"}, cause: Process exited with status 1\n at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\n at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:86\n at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\n\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:106\n at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:424\n at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:386\n at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:480\n at golang.org/x/sync/errgroup.(*Group).Go.func1()\n\tgolang.org/x/sync@v0.1.0/errgroup/errgroup.go:75\n at runtime.goexit()\n\truntime/asm_amd64.s:1650\nfailed to enable: 192.169.10.119 tiflash-9000.service, please check the instance’s log(/tidb-deploy/tiflash-9000/log) for more detail.\ngithub.com/pingcap/tiup/pkg/cluster/operation.toFailedActionError\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:645\ngithub.com/pingcap/tiup/pkg/cluster/operation.enableInstance\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:387\ngithub.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1\n\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:480\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\tgolang.org/x/sync@v0.1.0/errgroup/errgroup.go:75\nruntime.goexit\n\truntime/asm_amd64.s:1650\nfailed to enable/disable tiflash”}

【其他附件:截图/日志/监控】

看报错是用的tidb用户的互信,建议用tidb的互信试试,记得给tidb sudo权限

参考这里做一下免密互信吧

https://docs.pingcap.com/zh/tidb/stable/check-before-deployment#手动配置-ssh-互信及-sudo-免密码

我给tidb用户配置了互信和sudo,还是报错,我分析是 Unit file tiflash-9000.service does not exist 这个服务没法启动,

日志如下:
/usr/bin/sudo -H bash -c "systemctl daemon-reload && systemctl enable tiflash-9000.service"}, cause: Process exited with status 1", “errorVerbose”: "executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.169.10.119:22’ {ssh_stderr: Failed to enable unit: Unit file tiflash-9000.service does not exist.

Do you want to continue? [y/N]: (default=N) y

  • [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.117
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.117
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.116
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.116
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.118
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.116
  • [Parallel] - UserSSH: user=tidb, host=192.169.10.117
  • Download TiDB components
    • Download tiflash:v8.5.1 (linux/amd64) … Done
    • Download node_exporter: (linux/amd64) … Done
    • Download blackbox_exporter: (linux/amd64) … Done
  • Initialize target host environments
    • Initialized host 192.169.10.119 … Done
  • Deploy TiDB instance
    • Deploy instance tiflash → 192.169.10.119:9000 … Done
    • Deploy node_exporter → 192.169.10.119 … Done
    • Deploy blackbox_exporter → 192.169.10.119 … Done
  • Copy certificate to remote host
  • Generate scale-out config
    • Generate scale-out config tiflash → 192.169.10.119:9000 … Done
  • Init monitor config
    • Generate config node_exporter → 192.169.10.119 … Done
    • Generate config blackbox_exporter → 192.169.10.119 … Done
      Enabling component tiflash
      Enabling instance 192.169.10.119:9000
      Failed to enable unit: Unit file tiflash-9000.service does not exist.

这文件没有,你扩容的时候有问题吧,你用 tiup cluser reload xxx --skip-restart -R tiflash 刷新下 tiflash 的配置文件,应该也会刷新这文件

1 个赞

tiflash-9000的配置有吗?没有的话, tiup cluser reload 重新刷新一个,再试试能否扩容正常

tiup 在执行命令的时候,去192.169.10.119:22机器执行命令 systemctl daemon-reload && systemctl enable tiflash-9000.service 报错了,本质上是在这台机器上执行它不成功。可以手动去执行看看什么报错,是不是不存在服务 tiflash-9000.service 。