【注意】 Jmeter必须在系统配置成功jdk后,才能进行jmeter的安装配置运行操作。
如果,系统中没有安装jdk,详见使用Ubuntu16.04一键安装jdk进行相关jdk的安装配置。


【软件版本说明】

软件名 版本号
jdk 1.8.121
apache-jmeter 5.4.3

1.一键安装jmeter的shell脚本:

  1. #一键安装jmeter#
  2. #!/bin/bash
  3. sudo cd /opt
  4. sudo wget https://mirrors.tuna.tsinghua.edu.cn/apache/jmeter/binaries/apache-jmeter-5.4.3.tgz
  5. #pwd
  6. #extract jdk
  7. #sudo cd /opt
  8. sudo tar -xvf apache-jmeter-5.4.3.tgz -C /opt
  9. pwd
  10. echo "------------------------------------------------------------"
  11. echo "------------------start to install jmeter--------------------"
  12. #set environment
  13. export JMETER_HOME="/opt/apache-jmeter-5.4.3"
  14. if ! grep JMETER_HOME="/opt/apache-jmeter-5.4.3" /etc/profile
  15. then
  16. echo "JMTER_HOME=/opt/apache-jmeter-5.4.3" | sudo tee -a /etc/profile
  17. echo "export JMETER_HOME" | sudo tee -a /etc/profile
  18. echo "PATH=${JMETER_HOME}/bin:$PATH" | sudo tee -a /etc/profile
  19. echo "export PATH" | sudo tee -a /etc/profile
  20. fi
  21. source /etc/profile
  22. sudo update-alternatives --install /usr/bin/jmeter jmeter /opt/apache-jmeter-5.4.3/bin/jmeter 500
  23. sudo jmeter --version

2.用法:

  1. #wget https://coding.net/u/jamesz2011/p/ubuntu_lib/git/raw/master/jmeter/install_jmeter.sh
  2. sudo chmod a+x install_jmeter.sh
  3. sudo source install_jmeter.sh

3.一键安装jmeter成功的标志:
image.png