Jmeter分布式测试环境部署
1个master 两个slave 都是配置在同一个机器上
配置slave
两个slave步骤相同,修改一下相应的端口号即可。(我配置的两个slave端口号分别为1098和1097,下面以配置端口号1098的slave为例)
打开“jmeter.properties”这个文件,配置执行机远程启动端口(默认为 1099),
如改为:
server_port=1098
server.rmi.localport=1098
server.rmi.ssl.disable=true
打开“jmeter-server”这个文件,配置执行机远程启动IP
如改为:
DIRNAME=`dirname $0`
RMI_HOST_DEF=-Djava.rmi.server.hostname=10.1.248.48(slave所在机器的地址)
配置master
打开“jmeter.properties”这个文件,修改添加:
remote_hosts=10.1.248.48:1098,10.1.248.48:1097(slave的IP)
server_port=1099
client.rmi.localport=0
server.rmi.port=1234
server.rmi.localport=1099
server.rmi.ssl.disable=true
打开“jmeter.bat”这个文件,修改添加:
set rmi_host=-Djava.rmi.server.hostname=10.1.248.48:1099(本机ip)
Set ARGS=%DUMP% %HEAP% %NEW% %SURVIVOR% %TENURING% %PERM% %DDRAW% %rmi_host%
启动slave
分别在两个配置好的slave的bin目录下执行此命令
sh jmeter-server
启动成功屏幕输出下面这个
[aiwm@ZB-MAIL-STORE01 bin]$ sh jmeter-server
Using local port: 1098
Created remote object: UnicastServerRef2 [liveRef: [endpoint:[10.1.248.48:1098](local),objID:[-38cda5f7:17019190150:-7fff, -8990534376255230102]]]
Starting the test on host 10.1.248.48:1098 @ Thu Feb 06 14:07:08 CST 2020 (1580969228172)
执行脚本
在master执行脚本
命令一
jmeter -n -t st.jmx -R 10.1.248.48:1098,10.1.248.48:1097 -l /data/aiwm/zhongyl/test12.jtl命令二
jmeter -n -t st.jmx -r -l /data/aiwm/zhongyl/test12.jtl
执行成功后master屏幕输出下面这个
[aiwm@ZB-MAIL-STORE01 bin]$ jmeter -n -t st.jmx -r -l /data/aiwm/zhongyl/test12.jtl
Creating summariser <summary>
Created the tree successfully using st.jmx
Configuring remote engine: 10.1.248.48:1098
Using local port: 1099
Configuring remote engine: 10.1.248.48:1097
Starting remote engines
Starting the test @ Thu Feb 06 15:37:28 CST 2020 (1580974648482)
Remote engines have been started
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary + 1 in 00:00:00 = 4.9/s Avg: 2 Min: 2 Max: 2 Err: 0 (0.00%) Active: 10 Started: 44 Finished: 34
Tidying up remote @ Thu Feb 06 15:37:30 CST 2020 (1580974650908)
summary + 599 in 00:00:01 = 677.6/s Avg: 1 Min: 1 Max: 16 Err: 0 (0.00%) Active: 0 Started: 600 Finished: 600
summary = 600 in 00:00:01 = 550.5/s Avg: 1 Min: 1 Max: 16 Err: 0 (0.00%)
Tidying up remote @ Thu Feb 06 15:37:30 CST 2020 (1580974650926)
... end of run
... end of run
执行成功后slave屏幕输出下面这个
Starting the test on host 10.1.248.48:1098 @ Thu Feb 06 14:07:08 CST 2020 (1580969228172)
Finished the test on host 10.1.248.48:1098 @ Thu Feb 06 14:07:09 CST 2020 (1580969229899)