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 ),
本文出自seven的测试人生公众号最新内容请见作者的GitHub页:http://qaseven.github.io/