Jmeter 5.4.1:分布式模式:"Connection refused to host: nested exception is: java.net.ConnectException: Connection timed out: connect"

Jmeter 5.4.1: Distributed mode : "Connection refused to host: nested exception is: java.net.ConnectException: Connection timed out: connect"

我正在两个 windows VM 中使用 jmeter 5.4.1 设置分布式测试。 在从机中启动 jmeter 服务器。在 jmeter.properties 文件中进行以下更改(主从)

server.rmi.ssl.disable=true

在 master 中添加了 slave 机器 ip 和 运行 从 GUI 模式进行测试。获取连接被拒绝错误:

ERROR o.a.j.e.DistributedRunner: Failed to create engine at 192.168.xxx.xx java.rmi.ConnectException: Connection refused to host: 192.168.xxx.xx; nested exception is: java.net.ConnectException: Connection timed out: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:623) ~[?:?] at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:209) ~[?:?] at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196) ~[?:?] at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:343) ~[?:?] at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java:116) ~[?:?] at org.apache.jmeter.engine.ClientJMeterEngine.getEngine(ClientJMeterEngine.java:71) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.engine.ClientJMeterEngine.(ClientJMeterEngine.java:84) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.engine.DistributedRunner.createEngine(DistributedRunner.java:243) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.engine.DistributedRunner.getClientEngine(DistributedRunner.java:220) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.engine.DistributedRunner.init(DistributedRunner.java:92) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.gui.action.RemoteStart.doAction(RemoteStart.java:79) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.4.1] at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed[=12=](ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.4.1] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) ~[?:?] at java.awt.EventQueue.run(EventQueue.java:721) ~[?:?] at java.awt.EventQueue.run(EventQueue.java:715) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:740) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] Caused by: java.net.ConnectException: Connection timed out: connect at sun.nio.ch.Net.connect0(Native Method) ~[?:?] at sun.nio.ch.Net.connect(Net.java:576) ~[?:?] at sun.nio.ch.Net.connect(Net.java:565) ~[?:?] at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588) ~[?:?] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) ~[?:?] at java.net.Socket.connect(Socket.java:645) ~[?:?] at java.net.Socket.connect(Socket.java:595) ~[?:?] at java.net.Socket.(Socket.java:519) ~[?:?] at java.net.Socket.(Socket.java:293) ~[?:?] at sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket(TCPDirectSocketFactory.java:40) ~[?:?] at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:617) ~[?:?]

首先,您的一主一从“架构”没有任何意义,因为您只有一个负载生成器,如果没有进一步扩展的计划 - 您可以 run your JMeter test in command-line non-GUI mode 就是这样。

但是,如果您以后想要添加更多从站,请确保

  1. 机器在同一个subnet并且可以互相访问(或者设置适当的路由)
  2. 以下端口是 open in Windows Firewall
    • 端口1099(或任何SERVER_PORT)
    • 你定义的端口为server.rmi.localport
    • 您定义的端口client.rmi.localport
  3. 您通过 jmeter-server.bat 命令启动了从站

更多信息:

确保主从使用相同的 rmi 密钥库文件 (rmi_keystore.jks)。我在master上创建了它,然后scp给slaves。