Configuring JMeter as a Distributed Load Generator on Ubuntu
This guide covers setting up JMeter on Ubuntu to function as a remote load generator for distributed load testing.
Directory Setup and Download
Create a dedicated directory for JMeter installation:
mkdir -p /opt/jmeter
cd /opt/jmeter
Download the latest JMeter tarball from the Apache web site and transfer it to the server. Extract the archive:
tar xvf apache-jmeter-5.3.tgz
Environment Configuration
Configure the system environment variables to make JMeter accessible from any termianl session. Open the shell configuration file:
vim ~/.bashrc
Add the following exports at the end of the file:
# JMeter environment configuration
export JMETER_HOME=/opt/jmeter/apache-jmeter-5.3
export CLASSPATH=.:$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$JMETER_HOME/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$JMETER_HOME/bin:$PATH
Apply the configuration changes:
source ~/.bashrc
Verify the installation by checking the JMeter version:
jmeter --version
Successful output displays the JMeter version and copyright information.
Remote Test Configuration
To use this machine as a load generator, modify the JMeter properties file located in the bin directory:
cd /opt/jmeter/apache-jmeter-5.3/bin
vim jmeter.properties
Update the following properties to enable distributed testing:
server.rmi.create=true
server.rmi.ssl.disable=true
Starting the Load Generator
Retrieve the server's IP address using:
ip addr show
Start the JMeter server in server mode, binding to the specific IP address:
./jmeter-server -Djava.rmi.server.hostname=192.168.1.100
The server displays a message confirming the remote object creation with the endpoint information.
Master Controller Setup
On the master machine running the JMeter GUI, add the load generator's address to the remote hosts configuration. Open jmeter.properties on the master and configure:
remote_hosts=192.168.1.100:1099
Launch JMeter on the master machine. The configured remote load generator appears in the remote servers list, allowing distributed test execution across multiple machines.