用于在 Master 机器上运行的命令
mvn clean verify -DjMeterTestFile=Script_Name.jmx -Dremote_hosts='slave machine IP"
在 Master 机器中,测试正在执行,并且没有记录错误
从机命令
sh /'jmeter file path'/jmeter-server -Djava.rmi.server.hostname='Slave machine IP'
测试开始后,我在 Jmeter Slave 日志中收到以下错误
2019-02-14 06:42:45,001 ERROR o.a.j.s.RemoteListenerWrapper: testStarted(host) on 'Slave Machine IP'
java.rmi.ConnectException: Connection refused to host: 'Server machine IP'; nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) ~[?:1.8.0_191]
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) ~[?:1.8.0_191]
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) ~[?:1.8.0_191]
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129) ~[?:1.8.0_191]
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227) ~[?:1.8.0_191]
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179) ~[?:1.8.0_191]
at com.sun.proxy.$Proxy21.testStarted(Unknown Source) ~[?:?]
at org.apache.jmeter.samplers.RemoteListenerWrapper.testStarted(RemoteListenerWrapper.java:79) [ApacheJMeter_core-5.0.jar:5.0 r1840935]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:217) [ApacheJMeter_core-5.0.jar:5.0 r1840935]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:384) [ApacheJMeter_core-5.0.jar:5.0 r1840935]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
主机和从代理中的配置设置
主机配置
client.rmi.localport : 5060
https.socket.protocols: TLS1.2v
java.rmi.server.hostname : slave machine IP
server.rmi.ssl.disable : true
Plugins and Versions used
com.lazerycode.jmeter version 2.8.0
kg.apc:jmeter-plugins-extras:1.4.0
kg.apc:jmeter-plugins-standard:1.4.0
kg.apc:jmeter-plugins-autostop:0.1
kg.apc:jmeter-plugins-casutg:2.6
kg.apc:jmeter-plugins-csvars:0.1
kg.apc:jmeter-plugins-functions:2.0
kg.apc:jmeter-plugins-manager:0.19
kg.apc:jmeter-plugins-perfmon:2.1
kg.apc:jmeter-plugins-prmctl:0.3
kg.apc:jmeter-plugins-tst:2.1
kg.apc:jmeter-plugins-webdriver:2.3
com.blazemeter:jmeter-parallel:0.7
com.blazemeter:jmeter-plugins-wsc:0.7
从机配置
java.rmi.server.hostname='Slave Machine IP'
server.rmi.localport=42840
https.socket.protocols=TLSv1.2
server.rmi.ssl.disable=true
对于相同的配置,我在 JMeter 4.0 中没有收到错误