我正在尝试使用jmeter-maven-plugin运行一个简单的分布式jmeter测试,但无法使该插件启动远程节点。如果我在每个节点上手动启动jmeter-server,它将按预期运行,但是我不想这样做。
以下是插件配置和正在运行的插件的输出:
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<configuration>
<downloadExtensionDependencies>false</downloadExtensionDependencies>
<remoteConfig>
<serverList>192.168.40.5</serverList>
<startServersBeforeTests>true</startServersBeforeTests>
<stopServersAfterTests>true</stopServersAfterTests>
</remoteConfig>
<jmeterExtensions>
<artifact>com.abc:performance-tests:${project.version}</artifact>
</jmeterExtensions>
</configuration>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
</plugin>
14:10:38 [INFO] Executing test: Test Plan.jmx
14:10:38 [INFO] Arguments for forked JMeter JVM: [java, -Xms512M, -Xmx512M, -Djava.awt.headless=true, -jar, ApacheJMeter-5.1.1.jar, -d, /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter, -j, /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter/logs/Test Plan.jmx.log, -l, /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter/results/20190617-Test Plan.csv, -n, -r, -t, /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter/testFiles/Test Plan.jmx, -R, 192.168.40.5, -X, -Dsun.net.http.allowRestrictedHeaders, true]
14:10:38 [INFO]
14:10:38 [INFO] Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/home/jenkins/jenkins/workspace/performance-tests_IB-33953@tmp/withMaven289a3daf/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/home/jenkins/jenkins/workspace/performance-tests_IB-33953@tmp/withMaven289a3daf"
14:10:40 [INFO] Jun 17, 2019 2:10:40 PM java.util.prefs.FileSystemPreferences$1 run
14:10:40 [INFO] INFO: Created user preferences directory.
14:10:41 [INFO] Created the tree successfully using /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter/testFiles/Test Plan.jmx
14:10:41 [INFO] Configuring remote engine: 192.168.40.5
14:10:41 [INFO] Connection refused to host: 192.168.40.5; nested exception is:
14:10:41 [INFO] java.net.ConnectException: Connection refused (Connection refused)
14:10:41 [INFO] Failed to configure 192.168.40.5
14:10:41 [INFO] Stopping remote engines
14:10:41 [INFO] Remote engines have been stopped
14:10:41 [INFO] Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[192.168.40.5]
14:10:42 [INFO] Completed Test: /home/jenkins/jenkins/workspace/performance-tests_IB-33953/target/jmeter/testFiles/Test Plan.jmx
我的jmeter.properties很简单:remote_hosts=192.168.40.5
有人知道这里可能出什么问题吗?我知道我同时使用“全部启动”和“启动特定的远程主机”选项,但是我分别尝试了它们,但似乎都无法正常工作。
通过使用密钥库(与rmi_keystore不同)的SSH来保护远程节点本身。问题是否出在插件试图使用rmi_keystore登录到盒子本身的问题上?
答案 0 :(得分:2)
您似乎缺少执行块:
<execution>
<id>start jmeter-server</id>
<goals>
<goal>remote-server</goal>
</goals>
<configuration>
<runInBackground>true</runInBackground>
</configuration>
</execution>
查看远程服务器集成测试可能是可行的:
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/tree/master/src/it/remote-test