假设现在有 192.168.1.100(jmeter 控制器 C )、192.168.1.101(jmeter负载机 B)两台机器进行分布式测试,各个步骤如下
1. C 和B 安装jmeter,并运行bin目录下的jmeter-server.sh
2. project/src/test/jmeter/ 下放jmeter.properties,并设置多机负载
#---------------------------------------------------------------------------
# Remote hosts and RMI configuration
#---------------------------------------------------------------------------
# Remote Hosts - comma delimited
remote_hosts=127.0.0.1:1099,192.168.1.101:1099
#remote_hosts=localhost:1099,localhost:2010
3. 配置项目的pom.xml,在configuration中增加两个配置,如下
<plugins> .... <configuration> <remoteConfig> <startServersBeforeTests>true</startServersBeforeTests> <stopServersAfterTests>false</stopServersAfterTests> </remoteConfig> </configuration> ....
</plugins>
4. 确保C 和B两台计算机时间同步
5. 执行构建