jmeter分布式压测

集群原理

控制机发压测脚本到每台远程执行机,然后由控制机收集执行机结果
jmeter分布式压测_第1张图片

集群信息

master 192.168.119.1
slave1 192.168.119.152
slave2 192.168.119.152

SSL密钥

 [root@node2 bin]# ./create-rmi-keystore.sh 
What is your first and last name?
  [Unknown]:  rmi
What is the name of your organizational unit?
  [Unknown]:  My unit name
What is the name of your organization?
  [Unknown]:  My organisation name
What is the name of your City or Locality?
  [Unknown]:  Your City
What is the name of your State or Province?
  [Unknown]:  Your State
What is the two-letter country code for this unit?
  [Unknown]:  XY
Is CN=rmi, OU=My unit name, O=My organisation name, L=Your City, ST=Your State, C=XY correct?
  [no]:  yes

Enter key password for    
	(RETURN if same as keystore password):   //直接回车,不输入密码

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore rmi_keystore.jks -destkeystore rmi_keystore.jks -deststoretype pkcs12".
Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'
[root@node2 bin]# 
[root@node2 bin]# ll | grep rmi_
-rw-r--r--. 1 root root  2269 Feb 20 16:58 rmi_keystore.jks
[root@node2 bin]# 

将生成的rmi_keystore.jks拷贝到每一台机器的的jmeter bin目录下去

slave

slave运行在linux中,
配置bin/jmeter.properties
1、如果不使用ssl

server.
rmi.ssl.disable=true

2、打开配置

server_port=1099

3、启动

[root@node1 bin]# ./jmeter-server 
Created remote object: UnicastServerRef2 [liveRef: [endpoint:[192.168.119.152:44667](local),objID:[518ffd47:1690a00e9be:-7fff, -4933356588627657634]]]

master

如果不使用ssl

rmi.ssl.disable=true

配置bin/jmeter.properties:

remote_hosts=192.168.119.152:1099,192.168.119.153:1099

点击run–remote start–192.168.119.152:1099进行测试
jmeter分布式压测_第2张图片

可以看到152上的机器已经执行了测试任务
在这里插入图片描述

测试任务的结果也回传回了controller,可以查看
jmeter分布式压测_第3张图片

你可能感兴趣的:(jmeter分布式压测)