为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【 TiDB 使用环境】Win10的wsl2 Ubantu 20.04 LTS单机
【概述】单机安装TiDB集群,部署时报Error: failed to enable/disable pd,具体情况为
scp@LAPTOP-3LMMFT5D:~$ tiup cluster deploy ticluster v5.3.0 ./topo.yaml --user root -p
tiup is checking updates for component cluster …
Starting component cluster
: /home/scp/.tiup/components/cluster/v1.9.0/tiup-cluster /home/scp/.tiup/components/cluster/v1.9.0/tiup-cluster deploy ticluster v5.3.0 ./topo.yaml --user root -p
Input SSH password:
- Detect CPU Arch
- Detecting node 192.168.133.1 … Done
Please confirm your topology:
Cluster type: tidb
Cluster name: ticluster
Cluster version: v5.3.0
Role Host Ports OS/Arch Directories
- Detecting node 192.168.133.1 … Done
pd 192.168.133.1 2379/2380 linux/x86_64 /tidb-deploy/pd-2379,/tidb-data/pd-2379
tikv 192.168.133.1 20160/20180 linux/x86_64 /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv 192.168.133.1 20161/20181 linux/x86_64 /tidb-deploy/tikv-20161,/tidb-data/tikv-20161
tikv 192.168.133.1 20162/20182 linux/x86_64 /tidb-deploy/tikv-20162,/tidb-data/tikv-20162
tidb 192.168.133.1 4000/10080 linux/x86_64 /tidb-deploy/tidb-4000
prometheus 192.168.133.1 9090 linux/x86_64 /tidb-deploy/prometheus-9090,/tidb-data/prometheus-9090
grafana 192.168.133.1 3000 linux/x86_64 /tidb-deploy/grafana-3000
Attention:
1. If the topology is not what you expected, check your yaml file.
2. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: (default=N) y
- Generate SSH keys … Done
- Download TiDB components
- Download pd:v5.3.0 (linux/amd64) … Done
- Download tikv:v5.3.0 (linux/amd64) … Done
- Download tidb:v5.3.0 (linux/amd64) … Done
- Download prometheus:v5.3.0 (linux/amd64) … Done
- Download grafana:v5.3.0 (linux/amd64) … Done
- Download node_exporter: (linux/amd64) … Done
- Download blackbox_exporter: (linux/amd64) … Done
- Initialize target host environments
- Prepare 192.168.133.1:22 … Done
- Deploy TiDB instance
- Copy pd -> 192.168.133.1 … Done
- Copy tikv -> 192.168.133.1 … Done
- Copy tikv -> 192.168.133.1 … Done
- Copy tikv -> 192.168.133.1 … Done
- Copy tidb -> 192.168.133.1 … Done
- Copy prometheus -> 192.168.133.1 … Done
- Copy grafana -> 192.168.133.1 … Done
- Deploy node_exporter -> 192.168.133.1 … Done
- Deploy blackbox_exporter -> 192.168.133.1 … Done
- Copy certificate to remote host
- Init instance configs
- Generate config pd -> 192.168.133.1:2379 … Done
- Generate config tikv -> 192.168.133.1:20160 … Done
- Generate config tikv -> 192.168.133.1:20161 … Done
- Generate config tikv -> 192.168.133.1:20162 … Done
- Generate config tidb -> 192.168.133.1:4000 … Done
- Generate config prometheus -> 192.168.133.1:9090 … Done
- Generate config grafana -> 192.168.133.1:3000 … Done
- Init monitor configs
- Generate config node_exporter -> 192.168.133.1 … Done
- Generate config blackbox_exporter -> 192.168.133.1 … Done
- Check status
Enabling component pd
Enabling instance 192.168.133.1:2379
System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down
Error: failed to enable/disable pd: failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down
, 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 pd-2379.service”}, cause: Process exited with status 1
Verbose debug logs has been written to /home/scp/.tiup/logs/tiup-cluster-debug-2022-02-14-11-58-03.log.
log日志最后内容为:
2022-02-14T11:58:03.259+0800 INFO Enabling component pd
2022-02-14T11:58:03.259+0800 INFO Enabling instance 192.168.133.1:2379
2022-02-14T11:58:03.790+0800 ERROR SSHCommand {“host”: “192.168.133.1”, “port”: “22”, “cmd”: “export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c “systemctl daemon-reload && systemctl enable pd-2379.service””, “error”: “Process exited with status 1”, “stdout”: “”, “stderr”: “System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
”}
2022-02-14T11:58:03.791+0800 ERROR CheckPoint {“host”: “192.168.133.1”, “port”: 22, “user”: “tidb”, “sudo”: true, “cmd”: “systemctl daemon-reload && systemctl enable pd-2379.service”, “stdout”: “”, “stderr”: “System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
”, “error”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1\
at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\
at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:85\
at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:98\
at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:381\
at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:344\
at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
at golang.org/x/sync/errgroup.(*Group).Go.func1()\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
at runtime.goexit()\
\truntime/asm_amd64.s:1581”, “hash”: “382d0e95f1c68e2fe272266d77abd57f273f7f31”, “func”: “github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute”, “hit”: false}
2022-02-14T11:58:03.791+0800 ERROR System has not been booted with systemd as init system (PID 1). Can’t operate.
Failed to connect to bus: Host is down
2022-02-14T11:58:03.791+0800 DEBUG TaskFinish {“task”: “Setting service auto start on boot”, “error”: “failed to enable/disable pd: failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1\
at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\
at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:85\
at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:98\
at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:381\
at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:344\
at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
at golang.org/x/sync/errgroup.(*Group).Go.func1()\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
at runtime.goexit()\
\truntime/asm_amd64.s:1581\
failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.\ngithub.com/pingcap/tiup/pkg/cluster/operation.toFailedActionError\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:603\
github.com/pingcap/tiup/pkg/cluster/operation.enableInstance\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:345\
github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
golang.org/x/sync/errgroup.(*Group).Go.func1\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
runtime.goexit\
\truntime/asm_amd64.s:1581\
failed to enable/disable pd”}
2022-02-14T11:58:03.791+0800 DEBUG TaskFinish {“task”: “Setting service auto start on boot”, “error”: “failed to enable/disable pd: failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1\
at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\
at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:85\
at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:98\
at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:381\
at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:344\
at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
at golang.org/x/sync/errgroup.(*Group).Go.func1()\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
at runtime.goexit()\
\truntime/asm_amd64.s:1581\
failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.\ngithub.com/pingcap/tiup/pkg/cluster/operation.toFailedActionError\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:603\
github.com/pingcap/tiup/pkg/cluster/operation.enableInstance\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:345\
github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
golang.org/x/sync/errgroup.(*Group).Go.func1\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
runtime.goexit\
\truntime/asm_amd64.s:1581\
failed to enable/disable pd”}
2022-02-14T11:58:03.791+0800 DEBUG TaskFinish {“task”: “Setting service auto start on boot”, “error”: “failed to enable/disable pd: failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1\
at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\
at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:85\
at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:98\
at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:381\
at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:344\
at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
at golang.org/x/sync/errgroup.(*Group).Go.func1()\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
at runtime.goexit()\
\truntime/asm_amd64.s:1581\
failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.\ngithub.com/pingcap/tiup/pkg/cluster/operation.toFailedActionError\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:603\
github.com/pingcap/tiup/pkg/cluster/operation.enableInstance\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:345\
github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
golang.org/x/sync/errgroup.(*Group).Go.func1\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
runtime.goexit\
\truntime/asm_amd64.s:1581\
failed to enable/disable pd”}
2022-02-14T11:58:03.791+0800 INFO Execute command finished {“code”: 1, “error”: “failed to enable/disable pd: failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.: executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1”, “errorVerbose”: “executor.ssh.execute_failed: Failed to execute command over SSH for ‘tidb@192.168.133.1:22’ {ssh_stderr: System has not been booted with systemd as init system (PID 1). Can’t operate.\
Failed to connect to bus: Host is down\
, 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 pd-2379.service”}, cause: Process exited with status 1\
at github.com/pingcap/tiup/pkg/cluster/executor.(*EasySSHExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/ssh.go:174\
at github.com/pingcap/tiup/pkg/cluster/executor.(*CheckPointExecutor).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/executor/checkpoint.go:85\
at github.com/pingcap/tiup/pkg/cluster/module.(*SystemdModule).Execute()\
\tgithub.com/pingcap/tiup/pkg/cluster/module/systemd.go:98\
at github.com/pingcap/tiup/pkg/cluster/operation.systemctl()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:381\
at github.com/pingcap/tiup/pkg/cluster/operation.enableInstance()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:344\
at github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1()\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
at golang.org/x/sync/errgroup.(*Group).Go.func1()\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
at runtime.goexit()\
\truntime/asm_amd64.s:1581\
failed to enable: 192.168.133.1 pd-2379.service, please check the instance’s log(/tidb-deploy/pd-2379/log) for more detail.\ngithub.com/pingcap/tiup/pkg/cluster/operation.toFailedActionError\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:603\
github.com/pingcap/tiup/pkg/cluster/operation.enableInstance\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:345\
github.com/pingcap/tiup/pkg/cluster/operation.EnableComponent.func1\
\tgithub.com/pingcap/tiup/pkg/cluster/operation/action.go:437\
golang.org/x/sync/errgroup.(*Group).Go.func1\
\tgolang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57\
runtime.goexit\
\truntime/asm_amd64.s:1581\
failed to enable/disable pd”}
【背景】使用scp账户作为中控账户,scp和tidb账户已经配置互信,tidb账户已经按官网文档做了sudo相关设置,sudo -su root不需要密码
【现象】业务和数据库现象
deploy不成功
【业务影响】
【TiDB 版本】
TiDB v5.3.0,Tiup v1.9.2
【附件】
- 相关日志 和 监控
- TiUP Cluster Display 信息
scp@LAPTOP-3LMMFT5D:~$ tiup cluster display ticluster
tiup is checking updates for component cluster …
Starting componentcluster
: /home/scp/.tiup/components/cluster/v1.9.0/tiup-cluster /home/scp/.tiup/components/cluster/v1.9.0/tiup-cluster display ticluster
Error: Cluster ticluster not found
Verbose debug logs has been written to /home/scp/.tiup/logs/tiup-cluster-debug-2022-02-14-12-24-04.log.
-
TiUP Cluster Edit Config 信息
-
TiDB- Overview 监控
- 对应模块日志(包含问题前后1小时日志)