3
votes

I have configured JMeter cluster testing according to this manual - JMeter Distributed Testing Step-by-step

Both machines are CentOS 6 with disabled firewalls and have the same version of JMeter.

Project has built with JMeter's Java Samples:

enter image description here

All calls are going to back end. Through RMI calls, if to be accurate.

Master node configuration:

Updated jmeter.properties with slave IP

Run Jenkins job -> ant calls JMeter ant task -> launches test on Jmeter (it has built jar with java's sampler).

JDK 1.7.25 / ant 1.9.4 / JMeter 2.11;

Slave node configuration:

JDK 1.7.90 / ant 1.7.1 / JMeter 2.11;

Started jmeter-server.

After launching test job. It executes only on the master node. Request sending to slave node didn't happen.
I couldn't get a klue why this happenning.

Here is snippet from ant task:

<target name="jmeter-test" depends="jmeter-init, is_run_remote">
    <jmeter jmeterhome="${jmeter.home}"
            testplan="${basedir.unix}/${test.testplan.path}"
            resultlog="${basedir.unix}/${results.report.jmeter.generated.path}"
            failureproperty="test_failed"
            runremote="${is_remote}">
        <!-- jvm settings -->
        <jvmarg value="-Xms${jvm.xms}"/>
        <jvmarg value="-Xmx${jvm.xmx}"/>
        <!-- jmeter remoting properties -->
        <property name="remote_hosts" value="${remote_hosts}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" />
        <property name="java.rmi.server.hostname" value="${java.rmi.server.hostname}" />
        <property name="server.exitaftertest" value="${server.exitaftertest}" />
        <property name="client.rmi.localport" value="${client.rmi.localport}" remote="true" />
        <property name="server.rmi.localport" value="${server.rmi.localport}" remote="true" />
        <property name="sample_sender_client_configured" value="${sample_sender_client_configured}" remote="true" />
        <property name="mode" value="${remote.results.sending.mode}" remote="true" />
        <property name="asynch.batch.queue.size" value="${asynch.batch.queue.size}" remote="true" />

The main difference from jmeter.log is that usual test goes through compiling Samplers:

jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.functions.StringFromFile: setParameters(${LISTING_USERS_CSV}) 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostFreightSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.PostVehicleSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostFreightRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.region.PostVehicleRegionalSearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostFreightCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: post.country.PostVehicleCountrySearchSampler. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteFreightSearch. Uses tearDownTest: false 
2016/07/19 14:36:17 INFO  - jmeter.protocol.java.sampler.JavaSampler: Created class: search.execute.ExecuteVehicleSearch. Uses tearDownTest: false 

At case of remoting run it has different behavior:

jmeter.engine.ClientJMeterEngine: sent test to 127.0.0.1 basedir='.'
... set the run props
jmeter.engine.ClientJMeterEngine: sent run command to 127.0.0.1 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Remote engines have been started 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Started remote host:  127.0.0.1 (1469447953598) 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2016/07/25 14:59:13 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 
2016/07/25 14:59:13 INFO  - jmeter.reporters.Summariser: summary =      1 in     0s = ******/s Avg:     0 Min:     0 Max:     0 Err:     1 (100.00%) 
2016/07/25 14:59:13 INFO  - jmeter.JMeter: Finished remote host: 127.0.0.1 (1469447953740) 

How to make distributed testing?

2

2 Answers

1
votes

You need to run "jmeter-server" on both Jmeter master & client machine.

and then execute your script like this.

./jmeter -n -t jmeterscript.jmx -R 172.0.0.1(master-ip),(slave-ip) -l logfile.jtl

reference: http://jmeter.apache.org/usermanual/remote-test.html

1
votes

The solution was next:

  1. on the Slaves machines correct jmeter-server:

    DIRNAME=dirname $0

    RMI_HOST_DEF=-Djava.rmi.server.hostname=10.6.216.XXX

    ${DIRNAME}/jmeter ${RMI_HOST_DEF} -Dserver_port=60000 -s -j jmeter-server.log "$@"

just uncomment RMI_HOST_DEF and assign the IP address of this machine, and specify port - 60000 (default one).

On the main workstation (Windows 8.1) adapted test plan to Slaves architecture (CentOS 6) - updated all resources paths to Unix style and locate them the same way for everyone slave instance.

  1. Correct the remote-hosts with IP addresses and port for main mashine:

    remote_hosts=10.6.216.XXX:60000,10.6.216.XXX:60000

  2. Start jmeter-server on all slaves:

    [user@ECSC00103331 ~]$ jmeter-server Using local port: 60000 Created remote object: UnicastServerRef [liveRef: [endpoint:10.6.216.40:60000,objID:[2f100b79:15630b4bb73:-7fff, 6552789263830402879]]]

    Also increased ulimit value for every instance:

ulimit -u 50000

By default, it was 1024. You can check it with ulimit -a command.

  1. Start run from JMeter UI - Run -> Remote Start All. Snippet from CentOS console:

    Starting the test on host 10.6.216.XXX:60000 @ Thu Jul 28 11:53:12 MSK 2016 (1469695992526) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/etc/jmeter/lib/slf4j-nop-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/var/lib/jenkins/jobs/Fx-Performance-Tests-RMI/workspace/fx-performance-tests/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory] Uncaught Exception org.apache.jorphan.util.JMeterError: Could not return sample. See log file for details.

It works even with this strange exception.