TiFlash启动失败

使用tiup安装tidb + tiflash, tidb启动正常,tiflash无法启动。登录tiflash安装节点,手工运行下面的命令,依然无法启动。

scripts/run_tiflash.sh

查看日志,发现日志中有个FATAL异常,如下所示

vi log/tiflash_tikv.log

[2020/10/16 10:27:32.185 +08:00] [FATAL] [server.rs:597] ["failed to start node: \"[src/server/node.rs:216]: cluster ID mismatch, local 6883828949482383001 != remote 6884016428082984026, you are trying to connect to another cluster, please reconnect to the correct PD\""]

安装集群版本为v4.0.7

是否之前有安装过 TiDB 环境或者安装过没有清理干净?看报错是这个 tiflash 连接到另外一个环境的 PD。

安装过,然后用 tiup cluster destroy销毁了,重新装的,用什么命令才能彻底清理干净呢?
或者改什么配置能连现在的pd呢?

可以检查下 {deploy_dir}/conf/tiflash.toml 的 pd 设置是否正确,以及设置的 pd 节点是否在当前集群中,运行日志有没有报错

使用tiup cluster destroy后,重新安装,用tiup cluster start启动整个集群,pd, tidb和tikv这些都正常启动了,但是tiflash还是有问题,具体错误如下所示:

retry error: operation timed out after 2m0s
	tiflash 10.10.12.12:9000 failed to start: timed out waiting for port 9000 to be started after 2m0s, please check the log of the instance

Error: failed to start tiflash: 	tiflash 10.10.12.12:9000 failed to start: timed out waiting for port 9000 to be started after 2m0s, please check the log of the instance: timed out waiting for port 9000 to be started after 2m0s

Verbose debug logs has been written to /Users/lei.gu/work/projects/10-tidb-deployment/logs/tiup-cluster-debug-2020-10-17-10-17-57.log.
Error: run `/Users/lei.gu/.tiup/components/cluster/v1.2.0/tiup-cluster` (wd:/Users/lei.gu/.tiup/data/SDdYwMr) failed: exit status 1

如果登录到tiflash那台机器,手工运行scripts/run_tiflash.sh,可以正常启动tiflash。

目前我们整个集群有五台机器,tidb和pd部署在一台,tikv部署在三台,tiflash部署在另外一台。有一个差异是tiflash那台机器的操作系统是centos8,另外四台是centos7,不知道是否是操作系统版本导致的tiflash无法用tiup启动。

可以 journalctl 查一下 systemd 的操作记录

非常感谢!

找到原因了,查看journalctl的日志,发现有下面的错误,

failed at step exec spawning /data3/tidb-deploy/tiflash-9000/scripts/run_tiflash.sh Permission denied

查看是有执行权限的

[root@p-shbs-gpu-02 ~]# ll /data3/tidb-deploy/tiflash-9000/scripts/run_tiflash.sh
-rwxr-xr-x. 1 tidb tidb 437 Oct 17 10:10 /data3/tidb-deploy/tiflash-9000/scripts/run_tiflash.sh

网上说可能是SELinux是enforcing导致的,将其改为disabled,就可以成功启动了。

 vi /etc/selinux/config
SELINUX=disabled

看了另外三台,SELINUX都是enforcing, 但是可以成功启动相应的服务,所以猜测还是操作系统版本的问题,centos 8的安全机制可能更高一些。

1 个赞

:+1: 部署前可以先执行 tiup cluster check 对部署环境做下 preflight check

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