云主机jmeter环境配置

公共账号qafunc
个人账户jiangcong

从个人账户登录到公共账号

xxx@xxx:~$ sudo -iu qafunc

JDK

1.进入功能账号
2.命令行输入

//wget下载
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"
//解压
tar xzf jdk-8u141-linux-x64.tar.gz

3.环境变量配置

vim .profile

添加内容
#java
export JAVA_HOME=/home/qafunc/jdk1.8.0_141
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JRE_HOME=$JAVA_HOME/jre

4.验证java

//输入
java -version
//正确
java version "1.7.0_181"
OpenJDK Runtime Environment (IcedTea 2.6.14) (7u181-2.6.14-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.181-b01, mixed mode)

备注:
公共账号下,使用配置.profile,不会使用系统的默认Java

//公共账户配置java8
qafunc@xxx:~$ java -v
Unrecognized option: -v
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
qafunc@hzbdg-yuedu-test01:~$ java -version
java version "1.7.0_181"

//个人账户使用系统默认的Java7配置
hzjiangcong@xxx:~$ java -version
java version "1.7.0_181"
OpenJDK Runtime Environment (IcedTea 2.6.14) (7u181-2.6.14-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.181-b01, mixed mode)

Jmeter

1.进入功能账号
2.命令行输入

//wget下载
wget http://mirrors.shu.edu.cn/apache//jmeter/binaries/apache-jmeter-4.0.tgz
//解压
tar -zxvf apache-jmeter-4.0.tgz

3.环境变量配置

# jmeter
export JMETER=/home/qafunc/apache-jmeter-4.0
export CLASSPATH=$JMETER/lib/ext/ApacheJMeter_core.jar:$JMETER/lib/jorphan.jar:$JMETER/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$PATH:$JMETER/bin

4.验证java

qafunc@xxx:~$ jmeter -v
    _    ____   _    ____ _   _ _____       _ __  __ _____ _____ _____ ____
   / \  |  _ \ / \  / ___| | | | ____|     | |  \/  | ____|_   _| ____|  _ \
  / _ \ | |_) / _ \| |   | |_| |  _|    _  | | |\/| |  _|   | | |  _| | |_) |
 / ___ \|  __/ ___ \ |___|  _  | |___  | |_| | |  | | |___  | | | |___|  _ <
/_/   \_\_| /_/   \_\____|_| |_|_____|  \___/|_|  |_|_____| |_| |_____|_| \_\ 4.0 r1823414

Copyright (c) 1999-2018 The Apache Software Foundation

文件传输

背景:功能账号权限问题,无法直接上传
策略:scp到机器的tmp目录,然后修改文件权限,公共账号cp tmp路径的文件

qafunc@xxx:~$ cp /tmp/登录接口.jmx  path/
qafunc@xxx:~$ cd path/
qafunc@xxx:~/path$ ls -l
total 16
-rwxr-xr-x 1 qafunc netease 13844 Aug 24 17:33 登录接口.jmx

你可能感兴趣的:(云主机jmeter环境配置)