1

For distributed load testing with jmeter we need to specify the Djava.rmi.server.hostname before starting the jmeter. For the server start we can uncomment #RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx file in jmeter-server file.

But however to start the client we have to run jmeter.bat. And for distributed testing i have been using command line to run jmeter.bat file like this:

    apache-jmeter-3.0/bin/./jmeter.bat -Djava.rmi.server.hostname=127.0.0.1

so, is there a file where i can include this Djava.rmi.server.hostname like we did for the jmeter-server which will specify that the rmi hostname is 127.0.0.1?

I looked at the jmeter.bat file and jmeter file. I couldnt locate anything. Nevertheless, i want to specify Djava.rmi.server.hostname=127.0.0.1 so that i dont have to run the above highlighted line of command.

With much appreciation. Regards

Deepesh Thapa
  • 1,721
  • 3
  • 19
  • 29

3 Answers3

2

It seems your Client is running in Windows and your Server(Slaves) are running in Linux.Otherwise there is no need to configure #RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx if both Server and Client are running in Windows environment.

However, in your case you have to configure #RMI_HOST_DEF=-Djava.rmi.server.hostname=xxx.xxx.xxx.xxx as either

RMI_HOST_DEF=-Djava.rmi.server.hostname=localhost

or

RMI_HOST_DEF=-Djava.rmi.server.hostname=<ip of jmeter server>

And this is done to launch your Slave machine to communicate with the Client machine.It will dynamically assign a listening port to listen from Client.

You have to define adding the following to client (master) jmeter.properties file:

remote_hosts= xxx.xxx.xxx.xxx(your Slave machine ip)

Then just run from Client machine

./jmeter.bat -n -t <JMX file name> -r

For performing Remote test in Linux environment, you could find help in this question JMeter: Distributed (Remote) Testing in Linux Environment

Community
  • 1
  • 1
Adnan
  • 2,931
  • 3
  • 23
  • 35
0

It is set at the JVM which exports remote objects. Normally that is the server, but it can be the client if it exports callbacks.

What that means in the specific case of JMeter and your system I cannot say.

Normally it isn't necessary to set it at all, unless there is a DNS problem or a multi homed host. So I'm wondering why it's considered necessary in your case.

There is no file you can set it in.

user207421
  • 305,947
  • 44
  • 307
  • 483
0

Properties which you used to pass via '-D' command-line argument can be alternatively set via system.properties file (located in "bin" folder of your JMeter installation) in name=value form like:

java.rmi.server.hostname=127.0.0.1

You can double check system properties values using Debug Sampler and View Results Tree listener combination.

See Apache JMeter Properties Customization Guide to learn more about different JMeter properties types and ways of setting and/or overriding them.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133