jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: why hostname is localhost?
Date Wed, 11 Sep 2013 22:10:45 GMT
On 11 September 2013 18:09, sebb <sebbaz@gmail.com> wrote:
> On 11 September 2013 13:04, Flavio Cysne <flaviocysne@gmail.com> wrote:
>> Two possible solutions:
>>
>> 1. As suggested by sebb, localhost in /etc/hosts should be associated to
>> your current IP, not to 127.0.0.1 (loopback). You'll have to edit
>> /etc/hosts and change 127.0.0.1 with your current IP.
>
> I don't recall suggesting that.
>
> The problem normally arises if the host name for the client or server
> is defined as the loopback address.
> Of course if you call your host "localhost" then that would cause issues!
>
> The local address should be shown in the client and server logs, e.g.:
>
> 2013/09/11 17:59:59 INFO  - jmeter.JMeter: IP: a.b.c.d Name: client
> FullName: Client
> 2013/09/11 18:00:00 INFO  - jmeter.JMeter: Configuring remote engine for p.q.r.s
>
> 2013/09/11 17:59:47 INFO  - jmeter.JMeter: IP: p.q.r.s Name: server
> FullName: Server
> 2013/09/11 17:59:47 INFO  - jmeter.engine.RemoteJMeterEngineImpl:
> Starting backing engine on 1099
> 2013/09/11 17:59:47 INFO  - jmeter.engine.RemoteJMeterEngineImpl: IP
> address=a.b.c.d
>
> It is the last line that is important.

Sorry, that's wrong.
The last line is also the local IP address (of the server host), so it
should be p.q.r.s

> The client tells the server what IP to reply on, based on the IP
> address it finds for itself (this is part of RMI)
> The server will reply on that address; if the client says to reply on
> 127.0.0.1 of course it won't work (unless both client and server are
> on same host).

That's still true, but the log does not currently show the remote IP
address that was sent over RMI.
We'll add it for the next release.

>> 2. If machines' IPs change a lot (because of DHCP server) you could use
>> -Djava.rmi.server.hostname=$(ifconfig eth0 | sed -n "2s/[^:]*:[ \t]*\([^
>> ]*\) .*/\1/p") in your command line.
>> This command line will return your current IP (if the network interface
>> used is other than eth0, change it).
>>
>> As described in jmeter-server file, you have to add the variable below to
>> command line if you can neither change /etc/hosts nor fixate IP address.
>> jmeter-server executable command-line will look like this
>> $> RMI_HOST_DEF="-Djava.rmi.server.hostname=$(ifconfig eth0 | sed -n
>> '2s/[^:]*:[ \t]*\([^ ]*\) .*/\1/p')" ./jmeter-server
>>
>>
>> Both solutions work also for jmeter executable file. The second one is a
>> bit different 'cause you'll have to change RMI_HOST_DEF with JVM_ARGS
>> $> JVM_ARGS="-Djava.rmi.server.hostname=$(ifconfig eth0 | sed -n
>> '2s/[^:]*:[ \t]*\([^ ]*\) .*/\1/p')" ./jmeter

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message