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. 添加用户和环境变量:
bash环境下,所以在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
需要注消再登录后bash生效。
useradd -g 0 -s /bin/csh test
cat /opt/HP/HP_LoadGenerator/env.csh > /etc/.login
cat /opt/HP/HP_LoadGenerator/env.csh >~test/.cshrc
touch ~root/.rhosts ~test/.rhosts
5. 检查运行环境(在本机或使用VNC执行):
su - test cd /opt/HP/HP_LoadGenerator/bin/ ./verify_generator
6. 启动服务(用新增的用户test):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:
3378higkoolincn100ce5:verify_generator...OK
verify_generator...OK verify_generator...OK
Don't forget to make sure that the name of the controller machineis 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):
#!/bin/bash # /etc/init.d/loadrunner# Loadrunner负载生成器服务
DAEMON=m_daemon_setupARGV="$@"DIR=/opt/HP/HP_LoadGenerator/bin/USER=higkooUBIT="su - $USER -c "$UBIT "cd $DIR && ./$DAEMON $ARGV"运行服务:service loadrunner startm_agent_daemon ( 1808 )
------------------------------------------------------------------****************************************************************************************
遇见过的问题:
os中没有安装csh,因此怎么配置在跳转到配置用户的时候永远出现/bin/csh文件不存在
安装软件:/lib/ld-linux.so.2: bad ELF interpreter解决
failed to execute /bin/csh: 没有那个文件或目录
yum install tcsh
./m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
yum whatprovides libstdc++.so.5
yum install compat-libstdc++-33
使用的时候出现一个错误
bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
是因为64位系统中安装了32位程序
解决方法:
yum install glibc.i686
重新安装以后还有如下类系错误 再继续安装包
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
yum install libstdc++.so.6
PS:在使用一段时间linux的generator后会产生大量临时文件,存储在tmp下brr_开头的文件夹都是lr产生的临时文件,用如下方法清空
cd /tmp
rm -rf brr_*
PS:其他问题可以参考http://blog.csdn.net/crisschan/article/details/8988953