server节点端口绑定失败(EJ0003)
问题现象
打印日志中会有EJ0003的报错,报错信息如下:
[PID: 2267203] 2025-11-21-11:38:29.575.404 Bind_Failed(EJ0003): Failed to bind the IP port. Reason: The IP address and port have been bound already.
在CANN日志中存在关键字"socket type[2], *** Please check the port status and whether the port is being used by other process.",如下所示。此外需注意在通信算子下发时参数面建链阶段也会有端口绑定失败问题,可以根据报错日志中的"socket type"判断,若type为2,则为通信域集群协商时host侧网卡端口绑定失败,若type为0或者1,则为参数面端口绑定失败,可参考参数面端口绑定失败(EJ0003)
[ERROR] HCCL(3626636,all_reduce_test):2000-03-15-13:18:47.639.860 [hccl_socket.cc:110] [3626636][InitChannelStage][RanktableDetect] socket type[2], listen on ip[10.137.69.222%enp53s0f2] and specific port[60000] fail. Please check the port status and whether the port is being used by other process. [ERROR] HCCL(3626636,all_reduce_test):2000-03-15-13:18:47.639.869 [topoinfo_detect.cc:744] [3626636][InitGroupStage][RanktableDetect]StartRootNetwork failed, ret[7] [ERROR] HCCL(3626636,all_reduce_test):2000-03-15-13:18:47.639.874 [topoinfo_detect.cc:233] [3626636][InitGroupStage][RanktableDetect]SetupServer failed, hostIP[10.137.69.222%enp53s0f2] and hostPort[60000] ret[7] [ERROR] HCCL(3626636,all_reduce_test):2000-03-15-13:18:47.639.882 [op_base.cc:1071] [3626636][InitGroupStage][RanktableDetect]HcclGetRootInfo failed, ret[7]
可能原因
HCCL端口绑定失败,在通信域创建阶段,HCCL需要默认绑定60000-60031端口,若此时该端口已被绑定,则HCCL会绑定端口失败从而导致通信域创建失败。
解决方法
可以通过如下方式配置端口范围:
- 通过HCCL_IF_BASE_PORT环境变量指定Host网卡的起始端口号及设置端口预留范围。
- 若业务上需要在单个npu上同时执行多个进程,则需通过HCCL_HOST_SOCKET_PORT_RANGE设置HCCL在Host侧使用的通信端口范围来避免多进程之间端口使用冲突。
父主题: 集群信息协商相关