본문 바로가기

리눅스

[Linux] How to install JMeter on Linux

728x90

How to install JMeter on Linux

Installation platform

$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

Installing JAVA

 

 

$ amazon-linux-extras install java-openjdk11

$ java -version
openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

Installing JMeter

 

$ cd /usr/local/src/
$ export JMETER_VERSION=5.3
$ wget -q https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz
$ tar -xzf apache-jmeter-$JMETER_VERSION.tgz
$ mv apache-jmeter-$JMETER_VERSION /usr/local/jmeter

$ export JMETER_HOME=/usr/local/jmeter
$ export PATH=$JMETER_HOME/bin:$PATH

$ jmeter -v
    _    ____   _    ____ _   _ _____       _ __  __ _____ _____ _____ ____
   / \  |  _ \ / \  / ___| | | | ____|     | |  \/  | ____|_   _| ____|  _ \
  / _ \ | |_) / _ \| |   | |_| |  _|    _  | | |\/| |  _|   | | |  _| | |_) |
 / ___ \|  __/ ___ \ |___|  _  | |___  | |_| | |  | | |___  | | | |___|  _ <
/_/   \_\_| /_/   \_\____|_| |_|_____|  \___/|_|  |_|_____| |_| |_____|_| \_\ 5.3

Copyright (c) 1999-2020 The Apache Software Foundation

Run jmeter

jmeter -n -f -t www_testplan.jmx -l www_log.jtl -e -o www-report

Print out the jmeter report

docker run -d -v /usr/local/jmeter/bin/www-report:/usr/share/nginx/html -p 80:80 --name nginx nginx
728x90