Jmeter Maven 插件不启动远程节点

Jmeter Maven Plugin not starting remote nodes

我正在尝试 运行 使用 jmeter-maven-plugin 进行简单的分布式 jmeter 测试,但我无法通过插件启动远程节点。如果我在每个节点上手动启动 jmeter-server,它将按预期工作,但我不想这样做。

下面是插件配置和插件 运行ning 的输出:

<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 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

有谁知道这里可能出了什么问题?我知道我同时使用了全部启动和启动特定远程主机选项,但我分别尝试了这两个选项,但似乎都不起作用。

远程节点本身通过使用密钥库的 SSH 进行保护(与 rmi_keystore 不同)。问题可能是插件试图使用 rmi_keystore 登录到盒子本身吗?

您似乎缺少一个执行块:

<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