1. 先以root登陆要安装load generator的unix服务器。(目前仅支持uname=linux,SunOS,AIX,HP-UX)

2. 将LR的unix插件copy到服务器上并解压。

3. 运行install.sh 的脚本调起安装的wizard。 Next->Agree->Confirm Install->Finish (安装的log写在/tmp目录下)

4. 检查目录/opt/HP/HP_LoadGenerator (这个就是loadruner的服务器端插件的主目录了)

5. 设置设置几个环境变量

LR自带的是csh下的脚本,bash的脚本自己写,然后设置好切shell的时候自动source相应的脚本执行。

CSH下的脚本:

#!/bin/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:${M_LROOT}/lib:/usr/lib
else if ( `uname` == AIX ) then
setenv LIBPATH ${M_LROOT}/bin
else if ( `uname` == HP-UX ) then
setenv SHLIB_PATH ${M_LROOT}/bin
endif

setenv DISPLAY 0.0

setenv PATH ${M_LROOT}/bin:$PATH

注意:

1.这里Loadrunner原始的脚本给LD_LIBRARY_PATH的设置的值是${M_LROOT}/bin,实则library应该指向安装目录的/opt/HP/HP_LoadGenerator/lib下。

因此给LD_LIBRARY_PATH设置值为${M_LROOT}/bin:${M_LROOT}/lib:/usr/lib   (这里M_LROOT=/opt/HP/HP_LoadGenerator)

2.原始Loadrunner只提供了CSH的脚本,bash的自己写一份了,下面是自己写的

BASH的脚本

#/bin/bash
export PRODUCT_DIR=/opt/HP/HP_LoadGenerator
export M_LROOT=$PRODUCT_DIR
export LD_LIBRARY_PATH=$M_LROOT/bin:$M_LROOT/lib:/usr/lib
export DISPLAY='0.0'
export PATH=$PATH:$M_LROOT/bin

注:没按照原始文件根据uname判断来给LD_LIBRARY_PATH执行不同的值。

6. 在不同shell的配置里source这两个文件使得切换shell后执行  (以下方法仅适用于CENTOS-linux系统)

CSH

给文件/etc/csh.cshrc 最后增加 source /opt/HP/HP_LoadGenerator/env.csh

BASH

给文件/etc/profile 最后增加 source /opt/HP/HP_LoadGenerator/env.sh

7.切换SHELL 让source的程序文件执行生效或自己手动执行

8.检查loadrunner配置环境

进入/opt/HP/HP_Loadrunner下,运行verify_generator

[jaunty@localhost bin]$ ./verify_generator
===================================================
HP
Vuser Environment Verification Utility
===================================================

Product: HP LoadRunner 9.50
Version: 09.50.0000
Build: 3378
localhost.localdomain:

  • 提示找不到libstdc++.so.5, 就是缺libstdc++5相关包

解决办法:
yum -y install libstdc++.so.5
/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
verify_generator…OK
/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 directory
/opt/HP/HP_LoadGenerator/bin/lrv/limithost: line 154: [: : integer expression expected
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

只要verify 都通过没有错就可以了。如果其他的没错仅有Verify $M_LROOT …Failed ,也可以继续使用。

9. 确认防火墙已经关闭

10.运行 m_daemon_setup -install 成功会获取一个 processid

PS -auxww| grep m_agent

可以看到启动起来的进程信息

11.然后在本地的pc测试机里打开controller,设置load generator 不用RSH ,连接后变为ready 成功.

12.如果本地connet不上,则先检查服务器和本地测试pc之间的网络互通性再检查两端的防火墙设置。如果还有问题则可在服务器的/tmp目录下看到很多Loadruner agent产生的log,根据时间定位,打开查看细节问题。

 

转自:http://jaunty.me/blog/2011/03/loadrunner%e7%9a%84loadgenerator%e5%9c%a8linux%e4%b8%8a%e7%9a%84%e9%85%8d%e7%bd%ae%e5%92%8c%e9%83%a8%e7%bd%b2-%e4%bd%bf%e7%94%a8%e9%9d%9ersh%e8%bf%9e%e6%8e%a5/

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐