在 Linux 系统中安装Load Generator ,并在windows 调用方法
在 Linux 系统中安装Load Generator ,并在windows 调用
由于公司需要测试系统的最大用户承受能力,所以需要学习使用loadrunner。在安装的时候碰到了不少问题,所以写下此文章总结遇到的问题以及解决方案,希望能帮到大家。也希望大家转载注明出处。
Winsows 的Loadrunner 安装就不多讲了,这个太容易了。
以下是Linux 中安装 Load Generator 说明:
Linux 系统版本:CentOS5.4
Load Generator 版本 : Load Generator 11
安装步骤如下:
1. 到HP官网下载Load Generator 安装文件 Software,_Load_Generator_11.00_T7330-15010.iso
2.确保系统安装了c++ , gclib 相关工具(我的系统在安装前已经安装了gclib ,所以还不知道没装这个会发生什么问题)
3. 在Windows 系统下将Software,_Load_Generator_11.00_T7330-15010.iso 解压出来会有三个文件夹(HP , Linux , Solaris),这三个文件夹是相关系统的安装包。请根据你的系统选择对应的文件夹copy到 要安装的Linux 系统中。为什么要使用这种解压后copy的原因是因为我根据网上的方法copy iso 文件到Linux 系统中并使用挂载的方式进行安装,碰到了很多问题,所以使用这种方式,这可是我原创的哦。我是copy到/home/LoadRunner/目录下
4. 紧跟着就是安装了,只需要执行指令/home/LoadRunner/Linux/installer.sh 会出现如下图中的安装向导欢迎界面,选择Next [n] 即可。
5. 出现下图许可协议界面,也只需点击Agree [a],当然你可以选择View Agreement [v] 查看协议的详细内容
6. 出现确认安装界面,选择Install [i] 即可
7. 出现安装界面如下图
8. 完成安装,选择Finish [f] 即可,恭喜你安装成功
9. 紧跟着就是配制环境了,网上有说要配置env.csh 的,但我安装后env.csh 已经默认配置好了,这里也将的默认配置文件分享一下
setenv PRODUCT_DIR /opt/HP/HP_LoadGenerator
setenv M_LROOT $PRODUCT_DIR
if ( `uname` == SunOS ) then
setenv LD_LIBRARY_PATH ${M_LROOT}/bin
else if ( `uname` == Linux ) then
setenv LD_LIBRARY_PATH ${M_LROOT}/bin
else if ( `uname` == AIX ) then
setenv LIBPATH ${M_LROOT}/bin
else if ( `uname` == HP-UX ) then
setenv SHLIB_PATH ${M_LROOT}/bin
endif
setenv PATH ${M_LROOT}/bin:$PATH
10 .除了上文中讲到的还需要在/root/.bashrc文件中添加如下配制,保存修改后注销用户重用登录
export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
export M_LROOT=$PRODUCT_DIR
export LD_LIBRARY_PATH=${M_LROOT}/bin
export PATH=${M_LROOT}/bin:$PATH
11 . Load Generator会安装到/opt/HP/HP_LoadGenerator目录下,我也是使用默认的。进行/opt/HP /HP_LoadGenerator/bin 目录执行./verify_generator (不能使用root用户,至于为什么还不清楚) 检查安装是否成功,如果成功会有以下信息,
===================================================
HP
Vuser Environment Verification Utility
===================================================
Product: LoadRunner 11.0
Version: 11.0.0.8866
Build: 8866
localhost.localdomain:
verify_generator...OK
verify_generator...OK
verify_generator...OK
Don't forget to make sure that the name of the controller machine
is also in .rhosts
Verify $M_LROOT ...Failed
_____It was not possible to set the $M_LROOT from
_____the shell dot files. One of several things might be happening:
_____1) $M_LROOT is not set at all in the shell dot files.
_____2) There is some error in the shell dot files which stops their execution
_____ before it sets $M_LROOT.
_____3) There is conditional code in the shell dot files (most likely related to
_____ interactive and non interactive shells) and $M_LROOT is set
_____ only in one of the sections.
_____Aborting virtual user tests on host localhost.localdomain
verify_generator...OK
_______________________________________________
Summary:
________
Vuser Host localhost.localdomain: Failed
这些Failed 我都忽略了,因为这些Failed并不影响运行。我很希望哪位大虾看过此文章后能在此回复解释一下这些Failed可以解决吗?
上面是正确的信息,我刚开始的时候遇到了下面这些提示,注意其实这些提示都很直观,缺少了 libstdc++.so.5 , 安装就可以了。调用 yum install libstdc++.so.5 .安装后再调用 ./verify_generator 就可以看到上面的信息了。
===================================================
HP
Vuser Environment Verification Utility
===================================================
Product: LoadRunner 11.0
Version: 11.0.0.8866
Build: 8866
localhost.localdomain:
/opt/HP/HP_LoadGenerator/bin/lrv/chk_thread_lmt: error while loading shared libraries: libstdc++.so.5: cannot open
shared object file: No such file or
directory
/opt/HP/HP_LoadGenerator/bin/lrv/limithost: line 134: [: : integer expression expected
/opt/HP/HP_LoadGenerator/bin/lrv/chk_sems_lmt: error while loading shared libraries: libstdc++.so.5: cannot open
shared object file: No such file or d
irectory
/opt/HP/HP_LoadGenerator/bin/lrv/limithost: line 154: [: : integer expression expected
verify_generator...OK
verify_generator...OK
verify_generator...OK
Warning: The file .rhosts does not exist in the home directory of the user.
Verify $M_LROOT ...Failed
_____It was not possible to set the $M_LROOT from
_____the shell dot files. One of several things might be happening:
_____1) $M_LROOT is not set at all in the shell dot files.
_____2) There is some error in the shell dot files which stops their execution
_____ before it sets $M_LROOT.
_____3) There is conditional code in the shell dot files (most likely related to
_____ interactive and non interactive shells) and $M_LROOT is set
_____ only in one of the sections.
_____Aborting virtual user tests on host localhost.localdomain
verify_generator...OK
_______________________________________________
Summary:
________
Vuser Host localhost.localdomain: Failed
12 . 启动 Load Generator ,在安装的bin目录下输入 ./m_daemon_setup start 即可开户服务了 (不能使用root 用户启动)
13 . 修改防火墙策略,对54345端口开放,或者直接关闭防火墙(不建议直接关闭)
讲到这里安装步骤就完,现在讲如何在Windows 系统下启用 刚才安装的Load Generator
1. 打开Controller 的Load Generator 。 点击 场景--> Load Generator
2. 添加一个Load Generator 。点击 添加--> 输入名称(名称即ip)--> 选择平台 --> 点击更多 --> 点击 Unix 环境 --> 勾选“不使用RSH” --> 确定
3. 添加后测试连接,如果显示连接成功就功造成了,连接时如果有其它问题建议大家多思考,注意那些连接不成功的提前。我个人觉得LoadRunner 在提示之方面做的比较好,出了问题基本上看提示就知道问题在哪里。祝大家一切顺利。
http://115.com/file/clg3cm8h
方法二:
1. 在HP的官方网站上下载LoadRunner9.5 的Linux安装程序[T7177-15009.iso],安装文档[hp_man_LRIG9.50_01_pdf.pdf];
安装程序包括Hp、Ibm、Linux、Solaris系统的支持(LR9.0对应安装文件为[TLRNUX900WC_00.zip])。
2. 安装包的处理:
1. ZIP解压:unzip TLRNUX900WC_00.zip
2. 挂载ISO:mkdir /mnt/LoadRunner ; mount -t iso9660 -o loop T7177-15009.iso /mnt/LoadRunner
3. 开始安装,以LR9.5为例:
/mnt/LoadRunner/Linux/installer.sh
按提示操作,直接Next到完成。
4. 添加用户和环境变量:
useradd -g 0 -s /bin/csh higkoo
cat /opt/HP/HP_LoadGenerator/env.csh > /etc/.login
cat /opt/HP/HP_LoadGenerator/env.csh >~higkoo/.cshrc
touch ~root/.rhosts ~higkoo/.rhosts
5. 检查运行环境(在本机或使用VNC执行):
su - higkoo
cd /opt/HP/HP_LoadGenerator/bin/
./verify_generator
6. 启动服务(用新增的用户higkoo):
cd /opt/HP/HP_LoadGenerator/bin/
./m_daemon_setup start
7. 检查是否启动:
ps aux | grep m_agent_daemon
netstat -naop | grep 54345
8. 注意事项:
开启端口54345或关闭防火墙(service iptables stop)
正确设置后用verify_generator的检测结果是:
|
./verify_generator =================================================== HP Vuser Environment Verification Utility =================================================== Product: HP LoadRunner 9.50 Version: 09.50.0000 Build: 3378 higkoolincn100ce5: verify_generator...OK verify_generator...OK verify_generator...OK Don't forget to make sure that the name of the controller machine is also in .rhosts verify_generator...OK verify_generator...OK verify_generator...OK verify_generator...OK verify_generator...OK verify_generator...OK verify_generator...OK _______________________________________________ Summary: ________ Vuser Host higkoolincn100ce5: OK |
使用Controller连接,在“UNIX Environment Tab”下选择“Don't use RSH ”即可连接Linux负载机。

若使用RSH连接,则负载机必须安装RSH并正确配置,正如检测过程中描述的“Don't forget to make sure that the name of the controller machine”。
补充,Linux下似乎只支持Web/Http协议的脚本。譬如WinSock协议,从名称上都知道只适合Windows:
“Error (-81024): LR_VUG: The 'WinSock' type is not supported on 'LINUX' platforms .”
另外试了Java协议,确实不行,报错如下:
Error (-81024): LR_VUG: The 'General-Java' type is not supported on 'LINUX' platforms .
依赖库:yum -y --disablerepo=\* --enablerepo=AutoInstaller --nogpgcheck --skip-broken localinstall /mnt/CentOS_Final/CentOS/compat-libstdc++-33-3.2.3-61.i386.rpm
否则会报:m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
注意hosts文件的配置,如果机器名和hosts里配置不一致也会导致LoadRunner启动失败,
譬如:Error: Communication error: Failed to get the server host IP by calling the gethostbyname function.。
附上给LoadRunner定制的系统服务脚本(/etc/init.d/loadrunner):
# /etc/init.d/loadrunner
# Loadrunner负载生成器服务
DAEMON=m_daemon_setup
ARGV="$@"
DIR=/opt/HP/HP_LoadGenerator/bin/
USER=higkoo
UBIT="su - $USER -c "
$UBIT "cd $DIR && ./$DAEMON $ARGV"
运行服务:
service loadrunner start
m_agent_daemon ( 1808 ),
在 Linux 系统中安装Load Generator ,并在windows 调用方法的更多相关文章
- 在 Linux 系统中安装Load Generator ,并在windows 调用
原文地址:http://www.blogjava.net/qileilove/archive/2012/03/14/371861.html 由于公司需要测试系统的最大用户承受能力,所以需要学习使用lo ...
- 在linux系统中安装VSCode(Visual Studio Code)
在linux系统中安装VSCode(Visual Studio Code) 1.从官网下载压缩包(话说下载下来解压就直接可以运行了咧,都不需要make) 访问Visual Studio Code官网 ...
- [转]理解Linux系统中的load average
转自:http://heipark.iteye.com/blog/1340384 谢谢,写的非常好的文章. 一.什么是load average linux系统中的Load对当前CPU工作量的度量 (W ...
- Linux系统中的load average
1. load average 定义 linux系统中的Load对当前CPU工作量的度量.简单的说是进程队列的长度. Load Average 就是一段时间 (1 分钟.5分钟.15分钟) 内平均 L ...
- 理解Linux系统中的load average(图文版)转
一.什么是load average? linux系统中的Load对当前CPU工作量的度量 (WikiPedia: the system load is a measure of the amount ...
- 在Linux系统中安装caffe
学习深度学习已经很久了,但一直没有自己动手安装过caffe,因为工作需要,需要在linux系统中安装caffe,因此,在这里对安装过程进行记录. caffe配置起来比tensorflow更麻烦一些,我 ...
- 理解Linux系统中的load average(图文版)
本文转自:http://heipark.iteye.com/blog/1340384 一.什么是load average? linux系统中的Load对当前CPU工作量的度量 (WikiPedia: ...
- 理解Linux系统中的load average
理解Linux系统中的load average(图文版) 博客分类: Linux linux load nagios 一.什么是load average? linux系统中的Load对当前CPU工作 ...
- 详解在Linux系统中安装Tomcat
本文以在CentOS 7.6中安装Tomcat8.5为例进行安装,其他系统和版本都是大同小异的. 安装JDK 安装Tomcat之前,需要先安装JDK,可以参看之前的文章详解在Linux系统中安装JDK ...
随机推荐
- ECOS-Ecstore 伪静态规则
.htaccess 文件 RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME ...
- NSData与UIImage互相转换
1.//NSData转换为UIImage NSData *imageData = [NSData dataWithContentsOfFile: imagePath]; UIImage *image ...
- IP子网掩码格式转换
def exchange_maskint(mask_int): bin_arr = [' for i in range(32)] for i in range(mask_int): bin_arr[i ...
- 说说final关键字(好像有干货)
在java开发过程中,final是大家常用的关键字,无非就是用来修饰类,方法和变量,来表名类不能被继承,方法不会被覆盖,变量不能被改变,悄悄的说一句,private方法也隐式的final.通过一段时间 ...
- crontab定时任务以及其中中文乱码问题
一.小例子 1.写个测试文件 2.将文件权限变为可执行文件 3.在crontab文件中写定时任务 格式: 分/时 * * * 用户名 可执行文件路径 >> log文件路径 2>&am ...
- VBS脚本合集(自制脚本)
一.视频搜索器选择: Selectitem() '######################################### Function Selectitem() 'Set Vedio ...
- zencart低版本由php5.2.17升级PHP5.3环境下错误及解决方案
方法:有错误或者空白先打开错误提示,ftp看cache错误日志 或者 面板查看错误日志,再对比数据库是否正确,可拿脚本看是否能连接 \cp -r backipmysql/nlbarb_007li/ ...
- IoC容器Autofac正篇之依赖注入(七)
依赖注入,这个专业词我们可以分为两个部分来理解: 依赖,也就是UML中描述事物之间关系的依赖关系,依赖关系描述了事物A在某些情况下会使用到事物B,事物B的变化会影响到事物A: 注入,医生通过针头将药物 ...
- CentOS + EPEL YUM源地址
[bizosv] name=bizsov-centos-$releasever - centos baseurl=http://yikat:yikat@download.bizsov.com/ gpg ...
- override the hashcode and equals method in java
http://howtodoinjava.com/2012/10/09/working-with-hashcode-and-equals-methods-in-java/