centos下安装LoadGenerator

受Windows单机CPU、内存限制,负载机自身往往成为性能瓶颈,不能真实的反映被测系统的性能。并且当使用多台Windows机器作为负载机时,远程连接的稳定性和安全性也不理想,管理起来不方便。

推荐在Linux服务器上安装loadrunner的负载端程序。

安装步骤

step1安装依赖包(root权限)

# yum install glibc

# yum install libgcc

# yum install libgcc_s.so.1

下载compat-libstdc++-33-3.2.3-61.i386.rpm并上传至centos

# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm

centos下安装LoadGenerator

 

step2:上传Load Generator程序至centos ,并修改Linux目录可执行权限

centos下安装LoadGenerator

 

step3进入Linux文件夹,运行安装程序installer.sh

# cd Linux

# sh installer.sh 

centos下安装LoadGenerator

表示正式开始安装,键盘输入字母n继续安装

 

centos下安装LoadGenerator

输入字母a,接受协议条款,继续安装

 

centos下安装LoadGenerator

输入i,Enter键,执行安装

安装路径:/opt/HP/HP_LoadGenerator

centos下安装LoadGenerator

 

step4增加一个LR 负载端的用户,用户名ali,使用的shellcsh

# useradd -g 0 -s /bin/csh ali

说明:shell只是linux的一个外壳,每个linux系统都会有一个默认的shell程序,在centos下,默认shell是bash,但loadrunner使用的是csh,所以要添加一个使用csh的用户。

# more /etc/passwd命令查看,用户ali使用的是csh

centos下安装LoadGenerator

 

step5修改:LR配置

csh和bash有一个区别,就是在加载不同的shell时,可以加载不同的配置;

csh的默认配置在/etc/csh.cshrc,bash的默认配置在 /etc/profile,在这两个配置文件中,

可以加载shell的环境变量;

loadrunner自动创建了环境变量的配置文件,/opt/HP/HP_LoadGenerator/env.csh

修改csh的默认配置文件csh.cshrc,将loadrunner的配置加入环境变量

# vi /etc/csh.cshrc

在文件的最后一行添加source /opt/HP/HP_LoadGenerator/env.csh

 

env.csh设置DISPLAY 变量

# vi /opt/HP/HP_LoadGenerator/env.csh

在文件最后一行添加 setenv DISPLAY 0.0

centos下安装LoadGenerator

 

step6切换到ali用户,验证一下程序是否安装成功

[[email protected] HP_LoadGenerator]# su ali

[[email protected] HP_LoadGenerator]$ env

centos下安装LoadGenerator

[[email protected] HP_LoadGenerator]$ cd bin/

[[email protected] bin]$ ./verify_generator centos下安装LoadGenerator 

验证通过

 

step7:启动LR 负载程序

[[email protected] bin]$ ./m_daemon_setup start

centos下安装LoadGenerator

[[email protected] bin]$ ps -ef | grep m_agent_daemon centos下安装LoadGenerator

 

step8controller场景下添加Linux负载机

centos下安装LoadGenerator

点击More进行设置

centos下安装LoadGenerator

连接后Status是Ready,至此安装完成,并且可以使用。

centos下安装LoadGenerator