6

I have been using JMeter parameters to specify test attributes like testduration, rampup period etc for load test. I specify these parameters in shell script and it looks like this -

JMETER_PATH="/home/<user>/apache-jmeter-2.13/bin/jmeter.sh"
${JMETER_PATH} \   
-Jjmeter.save.saveservice.output_format=csv \
-Jjmeter.save.saveservice.response_data.on_error=true \
-Jjmeter.save.saveservice.print_field_names=true \    
-JCUSTOMERS_THREADS=1 \
-JGTI_THREADS=1 \
// Some more properties

Everything goes good here.

Now I added distributed testing and modified above script with JMeter Server related info. Hence new script looks as -

JMETER_PATH="/home/<user>/apache-jmeter-2.13/bin/jmeter.sh"
${JMETER_PATH} \
-Jjmeter.save.saveservice.output_format=csv \
-Jjmeter.save.saveservice.response_data.on_error=true \
-Jjmeter.save.saveservice.print_field_names=true \
-Jsample_variables=counter,accessToken \
-JCUSTOMERS_THREADS=1 \
-JGTI_THREADS=1 \
// Some more properties
-n \
-R     127.0.0.1:24001,127.0.0.1:24002,127.0.0.1:24003,127.0.0.1:24004,127.0.0.1:24005,127.0.0.1:24006,127.0.0.1:24007,127.0.0.1:24008,127.0.0.1:24009,12$
-Djava.rmi.server.hostname=127.0.0.1 \

Distributed test runs well but test does not take parameters specified in script above into consideration rather it takes the default value from JMeter test plan -

enter image description here

Did I mess up any configuration?

Tarun
  • 3,456
  • 10
  • 48
  • 82

2 Answers2

11

Use -G instead of -J for properties to be sent to remote machines as well. -J is local only.

-D[prop_name]=[value] - defines a java system property value.
-J[prop name]=[value] - defines a local JMeter property.
-G[prop name]=[value] - defines a JMeter property to be sent to all remote servers.
-G[propertyfile] - defines a file containing JMeter properties to be sent to all remote servers.

From here

RaGe
  • 22,696
  • 11
  • 72
  • 104
  • 1
    This is also true if you are using a properties file. The properties file is only used on the server nodes if you specify -G. Using -p is also only local. I feel this should be the default mode for jmeter-server. – Martin Mar 07 '18 at 10:55
0

Replace -J with -G, for more details go to link below or can see the image atached. If you want to run your load test in distributed mode refer to URL click here

And search for Server Mode (1.4.5)

you can refer the image

Lokesh kumar
  • 127
  • 1
  • 6