This is the first day of my participation in the More text Challenge. For details, see more text Challenge

Introduction to the

When we used Jmeter for stress test, sometimes we were limited by the configuration of the test machine. When we carried out a large concurrent test, the computer would be very stuck, and Jmeter would be stuck, and the maximum carrying capacity of the system could not be tested. Therefore, we need to use the distributed pressure measurement of Jmeter and use multiple test machines to share the pressure

Implementation process

Jmeter can select one machine as the control machine and another machine as the executive machine.

  • Write the script in the control machine
  • The script is sent to the execution machine
  • The executor executes the script
  • The execution result is sent back
  • Control machine summary

Note: Final number of threads = Number of script threads * number of executing machines

Each executor executes the same script, which is aggregated to the controller.

In actual combat

1. Install

Download address: official download address

Install Jmeter on all machines (Java environment required)

2. (Optional) Configure environment variables.

Add the JMETER_HOME value to the environment variable as the Jmeter installation location

Add JMETER_HOME\bin to Path

After Jmeter is installed, configure the distributed cluster

3. Distributed configuration

Modify jeter. properties in the bin directory of the Jmeter installation directory

Actuator configuration

Find remote_hosts in the configuration file and change it to the IP address: port number of the executing machine

The default port number is 1099, which can be changed – remote_hosts does not include the port number when using the default interface

Close the SSL

By default, SSL needs to be created for Jmeter. If SSL is not created, an error will be reported. In this case, SSL is disabled

At this point the execution machine configuration is complete

Next, run Jmeter -server.bat in the Jmeter bin directory to start the execution machine service

OK, that’s it

Actuator configuration

Set remote_hosts to the IP address and port number of the executing machine. For multiple actuators, the number is divided

192.168.1.105 remote_hosts = 192.168.1.103:1099192168 1.104

The port number must be the same as server_port on the server. The default port is optional

Close the SSL

server.rmi.ssl.disable=true
Copy the code

Start the Jmeter – server. Bat

At this point, the Jmeter distributed cluster is configured

use

Start the jmeter. Bat

After the script is written on the control machine, click Run

You can optionally start specified test machines or all test machines

The problem

  • Java versions and Jmeter need to be consistent across test machines to prevent problems

. Start the error Java rmi. Server. ExportException

Server failed to start: java.rmi.server.ExportException: Listen failed on port: 0; Nested exception is: Java. IO. FileNotFoundException: rmi_keystore. JKS (system could not find the file specified.) An error occurred: Listen failed on port:0; Nested exception is: Java. IO. FileNotFoundException: rmi_keystore. JKS (system could not find the file specified.) errorlevel=1
Copy the code

Cause: SSL is not disabled. Cancel the previous # and set the value to true

server.rmi.ssl.disable=true