DEBUG.WIKI
阿里云;从建站到云上业务;云服务器 · 数据库 · 对象存储;查看产品 →
PanstarCloud:部署应用,接入 AI,云服务器与 AI 网关
IPPeak:从目标地区访问网页,住宅代理、SEO 监测、广告验证

解决 JMeter 报错 Distributed testing remote engines sync fail 分布式引擎失联修复

排查 JMeter 主控节点(Master)调用远程施压节点(Server/Slave)时报 RemoteException: Cannot start remote engine 或 Connection refused to host,分析 RMI 端口映射与 SSL 证书配置。

问题现象

Master 运行 jmeter -n -t test.jmx -R 10.0.1.21,10.0.1.22 发起分布式压测时报错:

Configuring remote engine: 10.0.1.21
Failed to configure 10.0.1.21
java.rmi.ConnectException: Connection refused to host: 10.0.1.21; nested exception is:
    java.net.ConnectException: Connection refused

触发根因

  1. Slave 节点上的 jmeter-server 进程未启动或监听在错误的本地环回地址(127.0.0.1)上;
  2. JMeter 默认启用了 RMI SSL 双向认证,但主从节点之间未正确分发 rmi_keystore.jks 证书文件;
  3. 云安全组或防火墙未放行 RMI 注册端口(1099)及随机动态通信端口。

解决步骤

在内网可信环境禁用 RMI SSL 加密简化分布式组网

在 Master 和所有 Slave 的 bin/jmeter.properties 中追加:

server.rmi.ssl.disable=true

启动 Slave 时显式指定广播 IP 并固定本地通信端口

在 Slave 节点运行:

./bin/jmeter-server -Djava.rmi.server.hostname=10.0.1.21 -Dserver.rmi.localport=50000

放通 Slave 节点的 1099 与 50000 端口

执行防火墙放行:

iptables -I INPUT -p tcp -m multiport --dports 1099,50000 -j ACCEPT

验证确认

在 Master 重新触发远程执行:

控制台成功打印 Starting remote engines... Remote engines have been started,多机联合海量压测顺利推进。