`
喜欢蓝色的我
  • 浏览: 360912 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

linux 下安装&运行jmeter

 
阅读更多

1. 首先当然是要配置JDK。。。。。

2. 然后将下载好的JMETER压缩包放到LINUX机器上
 
tar -zxvf  压缩包
 
3.如何在LINUX上无界面启动JMETER,进入 bin
 
在windows上编辑jmx, 添加 生成概要或者可以自行导出日志
 
 ./jmeter -n -t test.jmx > log &
 
下面是官方文档中的一些参数解释

-n This specifies JMeter is to run in non-gui mode

没有界面运行

-t [name of JMX file that contains the Test Plan].

测试脚本

-l [name of JTL file to log sample results to].

-j [name of JMeter run log file].

-r Run the test in the servers specified by the JMeter property "remote_hosts"

-R [list of remote servers] Run the test in the specified remote servers

The script also lets you specify the optional firewall/proxy server information:

-H [proxy server hostname or ip address] 
-P [proxy server port]

Example : jmeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000  ------添加一个负载机

./jmeter -n -t sce_testcase1.jmx -p jmeter.properties    -----添加配置文件中的remote_host中的配置加压机

If the property jmeterengine.stopfail.system.exit is set to true (default is false), then JMeter will invoke System.exit(1) if it cannot stop all threads. Normally this is not necessary.

后台启动脚本  将日志导出到log
 
4 如何在LINUX 启动SERVER ,进入bin
先查看jmeter 是不是可执行文件,添加执行权限 chmod +x jmeter
./jmeter -s
[@zw_68_66 bin]# ./jmeter -s
显示
Created remote object: UnicastServerRef [liveRef: [endpoint:[10.10.68.66:40873](local),objID:[-901e698:1443f67ee05:-7fff, 2595752906788595176]]]
 
(如果遭遇loopback address 错误,请自行修改 etc/hosts,添加 [本机ip localhost])
5.如何配置负载机,进入bin
 
修改jmeter.protityes,在remote_host 添加 负载机ip:端口(推荐1099)
vim jmeter.protityes
在命令模式下 /remote_host  查找到这个remote_host
修改为remote_hosts=XXX.XXX.XXX.XXX:1099   (XXX.XXX.XXX.XXX负载机ip地址)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics