2

I am trying to run a simple distributed jmeter test with the jmeter-maven-plugin but I cannot get the remote nodes to be started by the plugin. If I manually start jmeter-server on each node, it will work as expected, but I don't want to do have to do that.

Below is the plugin configuration and output from the plugin running:

<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

My jmeter.properties is simply: remote_hosts=192.168.40.5

Does anyone know what could be wrong here? I know I'm using both the start all and start specific remote hosts option but I tried them both separately and neither seem to work.

The remote nodes themselves are secured via SSH that uses a keystore (not the same as the rmi_keystore). Is the problem perhaps that the plugin is trying to use the rmi_keystore to log on to the box itself?

AHungerArtist
  • 9,332
  • 17
  • 73
  • 109

1 Answers1

2

It looks like you are missing an execution block:

<execution>
  <id>start jmeter-server</id>
  <goals>
    <goal>remote-server</goal>
  </goals>
  <configuration>
    <runInBackground>true</runInBackground>
  </configuration>
</execution>

It may be work looking at the remote server integration test:

https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/tree/master/src/it/remote-test

Ardesco
  • 7,281
  • 26
  • 49
  • Wow, I had no idea about this option. I'm still a little confused as to how it would work, though. Wouldn't it need the node credentials to actually log on to the box to start the remote server? – AHungerArtist Jun 18 '19 at 14:46
  • This needs to be used in conjunction with the remote config section of the POM. More info is available here: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration – Ardesco Jun 19 '19 at 07:18
  • Does this require the RMI Registry service already being started? Is that how it works? – AHungerArtist Jun 20 '19 at 09:33
  • JMeter should be starting the RMI Registry service automatically since 2.3.1 – Ardesco Jun 20 '19 at 10:02
  • I feel like we're not talking about the same things. It only starts the registry service if you start the server, right? So what does the remote-server option do in that case, since it would already be started? What I want to accomplish, ideally, is to run this plugin from the master node and have it start the jmeter-server on the remote nodes. I don't want to have to start anything on the remote node. I don't see how that is possible currently. How can it know to log on to the remote nodes without credentials? – AHungerArtist Jun 20 '19 at 13:11
  • 1
    The config in this answer is to start JMeter as a remote node, you can then run another instance of the plugin using the config you originally supplied to connect to this remote node. As for how you authenticate, well that depends. If you haven't set up any security the remote node will be running with an open port that anybody can connect too. You could set up private keys to secure it if you don't like the idea of running open nodes (See https://jmeter.apache.org/usermanual/remote-test.html#setup_ssl). – Ardesco Jun 21 '19 at 07:09
  • 1
    To be clear the config in this answer cannot start a remote node on another server, it starts a local remote node. You would need to run this on each node you want to start, and then run your original config on the machine that connects to all the remote nodes you have started. – Ardesco Jun 21 '19 at 07:12
  • 1
    That last comment about it being a local remote node provided the clarification that I was missing before. There's nothing yet that will start everything (master and slaves) from one location. I still have to go each location and start it, whether it's using the plugin or jmeter directly. – AHungerArtist Jun 21 '19 at 11:17