i

JMeter Complete Guide

Dockerfile for JMeter Server / Slave

Dockerfile for JMeter Server / Slave

Added -Djava.rmi.server.hostname=$LOCALIP . LOCAL will be a variable, and the value will be passed at run time while creating the container.

LOCAL should be the public IP address of the host.

  • -p 1099:1099 – is used to map the 1099 port of the container with the host port 1099
  • -p 50000:50000 – is used to map the 1099 port of the container with the host port 50000

sudo docker run -dit --name master -p 1000:1000 vinsdocker/master /bin/bash
Container port 1000 is mapped to the host port 1000.
After creating all of the containers, the setup is almost as shown below.
./jmeter -n -t docker-test.jmx -Djava.rmi.server.hostname=192.168.1.1-Dclient.rmi.localport=60000 -R 192.168.1.2,192.168.1.3

  • -D java.rmi.server.hostname=192.168.1.1 -> Result the jmeter-master IP to the slave containers
  • -D client.rmi.localport=1000 → listening port of host
  • -R 192.168.1.2,192.168.1.3 -> Slaves host IP address

After creating all the containers
./jmeter -n -t docker-test.jmx -Djava.rmi.server.hostname=192.168.1.1 -Dclient.rmi.localport=60000 -R 192.168.1.2,192.168.1.3

  • -D java.rmi.server.hostname=192.168.1.1 1 -> Result the jmeter-master IP to the slave containers
  • -D client.rmi.localport=1000 → listening port of host
  • -R 192.168.1.2,192.168.1.3 -> Slaves host IP address