1、安装JDK
#wget http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz
#tar zxfjdk-8u111-linux-x64.tar.gz -C /usr/local/
#vim /etc/profile//新建JAVA环境变量
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=/usr/local/jdk/jre
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=./:/usr/local/jdk/lib:/usr/local/jdk/jre/lib
保存退出!
#source /etc/profile//使新加JAVA环境变量立即生效
#java -version//测试JAVA是否安装成功
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02,mixed mode)
2、下载apache-jmeter
#wgethttp://apache.fayea.com//jmeter/binaries/apache-jmeter-3.0.tgz
#tar zxf apache-jmeter-3.0.tgz -C /data/
#vim /etc/profile//把jmeter加入环境变量
export JMETER=/data/jmeter
export CLASSPATH=$JMETER/lib/ext/ApacheJMeter_core.jar:$JMETER/lib/jorphan.jar:$JMETER/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$JMETER/bin/:$PATH
保存退出!
#source /etc/profile
#jmeter -v//测试jmeter是否可以使用
Writing log file to: /data/jmeter.log
_ ____ _ ____ _ _ _____ _ __ __ _____ _____ _____ ____
/ \ | _ \ / \ / ___| | | | ____| | | \/ | ____|_ _| ____| _ \
/ _ \ | |_) / _ \| | | |_| | _| _ | | |\/| | _| | | | _| | |_) |
/ ___ \| __/ ___ \ |___| _ | |___ | |_| | | | | |___ | | | |___| _ <
/_/ \_\_| /_/ \_\____|_| |_|_____| \___/|_| |_|_____| |_| |_____|_| \_\ 3.0 r1743807
Copyright (c) 1999-2016 The Apache Software Foundation
到这里表示成功了!
可以开始使用jmeter对tomcat进行压力测试了!