1、控制机和代理机均设置,找到 bin/jmeter.properties,禁用ssl for rmi,添加如下:
server.rmi.ssl.disable=true
server_port=1099
server.rmi.port=1099
server.rmi.localport=1099
2、在控制机bin/jmeter.properties,修改agent地址:(可以添加本机地址)
remote_hosts=192.168.78.191,192.168.74.249
3、分别在控制机和代理机启动jmeter-server
a、可以指定ip启动(可能存在其他虚拟机启用):
jmeter-server -Djava.rmi.server.hostname=192.168.74.249
b、或者修改jmeter-server,添加一行:(貌似没得用,把电脑没用的连接都禁用掉,jmeter-server直接启动就不会是另外的ip了)
RMI_HOST_DEF=-Djava.rmi.server.hostname=192.168.74.249
便可在命令行直接执行jmeter-server:(或者执行jmeter-server.bat)
G:\applications\Jmeter\apache-jmeter-5.3\bin>jmeter-server
Could not find ApacheJmeter_core.jar ...
... Trying JMETER_HOME=..
Found ApacheJMeter_core.jar
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/G:/applications/Jmeter/apache-jmeter-5.3/lib/log4j-slf4j-impl-2.13.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/G:/applications/Jmeter/apache-jmeter-5.3/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Using local port: 1099
Created remote object: UnicastServerRef2 [liveRef: [endpoint:[192.168.74.249:1099](local),objID:[714608d0:1821ebf017c:-7fff, 3900440553917984632]]]
注意下面出现Created remote object: UnicastServerRef2 [liveRef: [endpoint:192.168.74.249:1099,objID:[714608d0:1821ebf017c:-7fff, 3900440553917984632]]]就可以了,且这里的ip地址是配置的agent地址
4、打开控制机jmeter.bat启动界面
在agent的命令行出现如下就可以了:(检测多个agent是否同时有输出)
Starting the test on host 192.168.74.249 @ Thu Jul 21 11:14:36 CST 2022 (1658373276791)
Finished the test on host 192.168.74.249 @ Thu Jul 21 11:14:37 CST 2022 (1658373277989)