32
votes

I'm trying to set up a distributed load testing environment using JMeter. I need to set up the remote clients using something portable like a Linux Live CD, but whenever I attempt to launch jmeter-server in Linux, I receive the following error...

Created remote object: UnicastServerRef [liveRef: [endpoint:[127.0.0.1:49018](local),objID:[3b0d3d42:12985b7a49b:-7fff, -8459389540436649718]]]
    Server failed to start: java.rmi.RemoteException: Cannot start. testbox01.qa.nwr.lan is a loopback address.

After extensive googling, the only remedy I can find is to edit the /etc/hosts file so the hostname maps to something other than the 127.0.0.1 loopback address. I've tried this using Ubuntu, Fedora and CentOS, and apparently they all default to setting the hostname to 127.0.0.l.

The way I see it, I have four options...

1) Customize the /etc/hosts file for every remote test box I set up, which involves upwards of 20-50 dynamically DHCP-assigned IP addresses.

2) Figure out a way to force Linux itself to assign the hostname to its DHCP IP address by default. This is certainly the more graceful solution, but I have no idea how to do this. Anyone know?

3) Find and use a Linux distro available as a Live CD that doesn't map its hostname to 127.0.0.1 by default. Anyone know one?

4) Dive into JMeter's code and start yanking wires, but if it comes to this, I'd just as soon use another open source tool with a slimmer feature set, but whose distributed architecture doesn't suffer from this issue.

If anyone has any advice, I'd be grateful. Thanks!

5
Not sure is this helps but I found a bug which seems to contain a patch for this issue. bugs.launchpad.net/ubuntu/+source/jakarta-jmeter/+bug/589042Glen
@Glen - Thanks for the lead, GlenSyndog
@Glen: You should post your comment as an answer so you get credit for it.Bill the Lizard

5 Answers

45
votes

In latest version, you can run your script with:

./jmeter-server -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx

Replace xxx.xxx.xxx.xxx with this server's IP address, i.e., the IP address that the controlling jmeter machine will use to connect to this server.

5
votes

Looks like Glen was right on the money with his comment.

Not sure is this helps but I found a bug which seems to contain a patch for this issue.

https://bugs.launchpad.net/ubuntu/+source/jakarta-jmeter/+bug/589042

Thanks again, Glen!
(If you decide to make it into an actual answer, I'll be sure to accept it!)

4
votes

Change your hostname from localhost to your right ip address.

  1. Check your hostname

    hostname

  2. Check your internet ip address

    ifconfig

  3. Add this line to /etc/hosts

    your_ip_address your_hostname

  4. Comment hostname which assigned localhost in /etc/hosts

4
votes

I was able to get it to start after setting this environment variable:

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

Also have downloaded jmeter 2.8 from here: http://archive.apache.org/dist/jmeter/binaries/

Ubuntu apt-get version is 2.3.4

1
votes

You can edit jmeter.server file to add:

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

This solved mine problem. You can try to check this page for more details.