背景说明
jmeter压测记录
Centos安装jmeter
安装wget
yum -y install wget
jmeter安装&解压
新建: mkdir cd /usr/local/jmeter
进入: cd /usr/local/jmeter
安装: wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-3.3.tgz
解压: tar -zxvf apache-jmeter-3.3.tgz
配置系统环境变量(最后添加)
vim /etc/profile
export JMETER_HOME=/usr/local/jmeter/apache-jmeter-3.3
export CLASSPATH=
J
M
E
T
E
R
H
O
M
E
/
l
i
b
/
e
x
t
/
A
p
a
c
h
e
J
M
e
t
e
r
c
o
r
e
.
j
a
r
:
JMETER_HOME/lib/ext/ApacheJMeter_core.jar:
JMETERHOME/lib/ext/ApacheJMetercore.jar:JMETER_HOME/lib/jorphan.jar:
J
M
E
T
E
R
H
O
M
E
/
l
i
b
/
l
o
g
k
i
t
−
2.0.
j
a
r
:
JMETER_HOME/lib/logkit-2.0.jar:
JMETERHOME/lib/logkit−2.0.jar:CLASSPATH
export PATH=
J
M
E
T
E
R
H
O
M
E
/
b
i
n
:
JMETER_HOME/bin:
JMETERHOME/bin:PATH:$HOME/bin
source /etc/profile
jmeter -v
1.png
mac安装jmeter
安装wget
brew install wget
新建jmeter目录
安装&解压
wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-3.3.tgz
tar -zxvf apache-jmeter-3.3.tgz
进入apache-jmeter-3.3/bin/目录
执行: sh jmeter
启动jmeter
启动脚本 start_jmeter.sh
#!/bin/bash
cd xxxx/xxxx/apache-jmeter-3.3/bin
sh jmeter
echo start end
设置别名
vi .zshrc & bash_profile
alias start_jmeter="/xxxx/xxxx/start_jmeter.sh"
jmeter分布压测部署
找到Jmeter的bin目录下jmeter.properties文件
vim jmeter.properties
修改添加remote_hosts,默认端口号1099
2.png
打开jmeter,查看
3.png
压测脚本&参数化
4.png