NAT-Distributed testing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NAT-Distributed testing

Aki Shidary

Hi! I am trying to set up a distributed testing config when the controller host (Master-client) is on the main network and the remote (slave-server) is behind a NAT.
 
Just to share my half day experiments (‘cos i did not find a clear explanation on the Net) and ask a couple of questions:
 
1. First of all I dont use SSL and disable it on both types of hosts (master/slave)
in jmeter.properties: server.rmi.ssl.disable=true  //or jmeter [-n -t jmeter.jmx -RXXX] -Jserver.rmi.ssl.disable=true’.
 
2. On the remote (slave-server), which is behind NAT, RMI should be told its external IP (otherwise it publishes its internal NAT IP)
in jmeter-server: RMI_HOST_DEF=-Djava.rmi.server.hostname=EXTERNAL_IP
 
3. Ports part in jmeter.properties (setup):
- on the controller (master-client) we setup host:port of the remote (slave-server) in remote_hosts=
- on the controller (master-client) we set port client.rmi.localport=NNNN (will use NNNN++1 iptables block ingress)
- on the remote (slave-server) we set server.rmi.localport=MMMM
 
4. Comments on ports (interaction):
- «Main» port of the communication (which i dont change) by default is 1099 and used to listen by RMI registry on the remote (slave-server) host.
- After the first step of connection from controller_master_client:RANDOM to remote_slave_server:1099 the remote (slave-server) announces (tells) its port for farther communication MMMM (remote function calls, server.rmi.localport=MMMM). So farther calls do look like so: from controller_master_client:RANDOM to remote_slave_server:MMMM.
 
- So for the remote (slave-server) NAT there should be farwarded (published,exposed) only two ports 1099 and MMMM
 
- At this point the Test plan is already sent to the remote (slave-server) and executed
 
- Also, while communicating, the controller (master-client) announces (tells) its port for backward traffic (remote Jmeter Listeners, client.rmi.localport=NNNN).
So the traffic is: from remote_slave_server:RANDOM to controller_master_client:NNNN++1
 
(NNNN multiple ports starting from NNNN+1 and incrementing in my case those were two)
 
Issues and my ask for help:
 
According to docs the default 1099 port can be changed by the server_port in jmeter.properties.
- What is the role of server.rmi.port (on either hosts)?
* I can assume that it is used on the controller (master-client) side to override default port when it’s not specified in remote_hosts?
* Or server_port is internal port for communication with RMI service? And the server.rmi.port is the actual main external port for remote (slave-server)? (this statment does not agree with docs)
 
And the last: My CentOS firewalld did block the NNNN+1 port incoming connections untill I systemctl stop’ed it. Why? (CentOS 8 from the box)
 
Thanx!
 
--
Aki Shidary
Reply | Threaded
Open this post in threaded view
|

Re: NAT-Distributed testing

glinius@live.com
As per  Remote hosts and RMI configuration
<https://jmeter.apache.org/usermanual/properties_reference.html#remote>  


> client.rmi.localport
>
> Parameter that controls the RMI ports used by RemoteSampleListenerImpl and
> RemoteThreadsListenerImpl (The Controller)
> Default value is 0, which means ports are randomly assigned. If this is
> non-zero, it will be used as the base for local port numbers for the
> client engine. At the moment JMeter will open
*
> up to three ports
*
>  beginning with the port defined in this property.
*
> You may need to open corresponding ports in the firewall on the Controller
> machine.
*
>

So I would recommend checking which ports are being used by JMeter using
i.e.  netstat <https://en.wikipedia.org/wiki/Netstat>   tool and open them
in the firewall.

You will also need to configure the  port forwarding
<https://en.wikipedia.org/wiki/Port_forwarding>   on NAT level otherwise the
master won't be able to "see" the slave.

An example of master-slave network configuration can be found in the  JMeter
Distributed Testing with Docker
<https://www.blazemeter.com/blog/jmeter-distributed-testing-with-docker>  
article.





--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re[2]: NAT-Distributed testing

Aki Shidary

Thanks for the answer. =)
 
All mentioned sources I used to make my «research» ;)  But in BlazeMeter docs there are transperent network (without NAT) sugested and docs on parameters on jmeter.apache.org are not very strieght. We have two hosts and two roles for each. So it is four combinations. And the docs are not so clear which port in which case and who uses.
 
Check it out! for the server_port and server.rmi.port it is written 1099 to be default. There are statements: «used by the server» and «used to access the server» now I can guess, that «used by» means «local» and «used to access» means remote. But still confusing. We specify «remote» port in «remote_hosts». So «server.rmi.port» overrides 1099 in case if I dont specify port in «remote_hosts»? confusing… to understand. In addition I saw non-referenced behavior but I may be mistaken, I had some issues with versions at start.
Also for me it was not abvious that the port to connect to I declare on the accepting host.
 
I know its my fault, the message is too long to read =) I tryed to cover all blank spaces.
Offcourse I use netstat and wireshark!
I do NAT port farwarding on the remote-slave-server machine for ports 1099 and (in my case 4000)
 
My question about the ports is that controller-master-client firewalld is blocking incoming connections on opened ports NNNN++1 (client.rmi.localport). And It is not behind a NAT. I suppose that it is because ports are higher then 1000… but I am not sure.
 
PS Not three but two ports NNNN+1 and NNNN+2 are actualy were used.
 

>Суббота, 3 апреля 2021, 12:07 +03:00 от [hidden email] <[hidden email]>:

>As per Remote hosts and RMI configuration
>< https://jmeter.apache.org/usermanual/properties_reference.html#remote >
>
>
>> client.rmi.localport
>>
>> Parameter that controls the RMI ports used by RemoteSampleListenerImpl and
>> RemoteThreadsListenerImpl (The Controller)
>> Default value is 0, which means ports are randomly assigned. If this is
>> non-zero, it will be used as the base for local port numbers for the
>> client engine. At the moment JMeter will open
>*
>> up to three ports
>*
>> beginning with the port defined in this property.
>*
>> You may need to open corresponding ports in the firewall on the Controller
>> machine.
>*
>>
>
>So I would recommend checking which ports are being used by JMeter using
>i.e. netstat < https://en.wikipedia.org/wiki/Netstat > tool and open them
>in the firewall.
>
>You will also need to configure the port forwarding
>< https://en.wikipedia.org/wiki/Port_forwarding > on NAT level otherwise the
>master won't be able to "see" the slave.
>
>An example of master-slave network configuration can be found in the JMeter
>Distributed Testing with Docker
>< https://www.blazemeter.com/blog/jmeter-distributed-testing-with-docker >
>article.
>
>
>
>
>
>--
>Sent from:  http://www.jmeter-archive.org/JMeter-User-f512775.html
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail:  [hidden email]
>For additional commands, e-mail:  [hidden email]
 
 
--
Aki Shidary