吐槽一下tiflash启动因端口冲突导致失败

tidb 版本 7.5.5

今天reload了一下tiflash发现一直起不来,启动tiflash失败日志如下

[2025/03/14 15:25:33.792 +08:00] [INFO] [SchemaSyncService.cpp:181] ["SchemaSyncService stopped"] [thread_id=1]
[2025/03/14 15:25:35.484 +08:00] [INFO] [Server.cpp:1070] ["Let tiflash proxy shutdown"] [thread_id=1]
[2025/03/14 15:25:35.484 +08:00] [INFO] [Server.cpp:1073] ["Wait for tiflash proxy thread to join"] [thread_id=1]
[2025/03/14 15:25:35.558 +08:00] [INFO] [Server.cpp:1075] ["tiflash proxy thread is joined"] [thread_id=1]
[2025/03/14 15:25:35.558 +08:00] [ERROR] [<unknown>] ["null context when constructing CivetServer. Possible problem binding to port."] [source=Application] [thread_id=1]
[2025/03/14 15:25:35.558 +08:00] [INFO] [<unknown>] ["shutting down"] [source=Application] [thread_id=1]
[2025/03/14 15:25:35.559 +08:00] [INFO] [BaseDaemon.cpp:307] ["Stop SignalListener thread"] [source=BaseDaemon] [thread_id=609]

看到日志猜测是因为端口冲突,然后一直排查tiflash的 tcp_port, http_port,发现这两个端口并未被使用,然后就往其他方向排查问题了。

最后经过查看文档才知道tiflash有6个端口,最终定位到metrics_port和其他服务冲突了

吐槽点,日志没写清楚是哪个端口冲突了,排查起来很浪费时间。

1 个赞

可以去 建议反馈 版块发贴,有贡献积分可以拿。 :yum:

1 个赞

这里报错确实不够清晰,我调整到产品需求建议里面。后来是如何定位到 metrics_port和其他服务冲突了的?是通过文档找到默认端口,一个一个检查的嘛?

1 个赞

是,通过edit-config查看到tiflash的部署信息,发现之前部署的时候6个端口都自定义了,然后挨个排查,最终定位到是metrics port跟别的服务冲突了。

PS: 那几个端口配的都比较大30000+,同事说这是操作系统临时端口段,很容易冲突,这次也是巧合,刚重启就被用了。

  tcp_port: 
  http_port: 
  flash_service_port: 
  flash_proxy_port: 
  flash_proxy_status_port: 
  metrics_port: 

有人在 github 上开 issue 了
https://github.com/pingcap/tiflash/issues/10005

后续跟进这个即可。

拿着我们发现的问题去提issue,甚至连日志都没动,有点厉害 :sweat_smile:

这不是挺好的么,研发都是看 ISSUE 修复问题的,统一管理。

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