LoadRunner 安装方法与系统环境初始化过程

来源:互联网 发布:中小型网络拓扑图 编辑:程序博客网 时间:2024/05/16 12:15

了解过性能测试的朋友,想必对LoadRunner一定不陌生。

    不错,LoadRunner很强大。但你是否能发挥LoadRunner的强大功能呢?

   本文介绍笔者在实践过程中批量安装LoadRunner和初始化环境的过程(windows/Linux):

------------------ Windows ------------------

1、 安装.net framwork 3.5
2、 安装LoadRunner(安装包路径和程序安装路径中不要有中文)
3、 安装JDK(下载官方最新安装包,所有机器安装目录建议相同)
4、 安装C++运行库
        Microsoft Visual C++ 2005 Redistributable + sp1
        Microsoft Visual C++ 2008 Redistributable + sp1
5、 将系统临时文件存在在空间最大的磁盘上。譬如执行批处理如下:
        wmic ENVIRONMENT where "name='temp' or name='tmp'" set VariableValue='D:\temp'
6、 修改系统注册表,增加系统最大吞吐能力。批处理如下:
        echo Yes | reg add HKLM\System\CurrentControlSet\Services\tcpip\Parameters /v MaxUserPort /t reg_Dword /d 65534 /f
        echo Yes | reg add HKLM\System\CurrentControlSet\Services\tcpip\Parameters /v TcpTimedWaitDelay /t reg_Dword /d 5 /f
7、 保证RemoteRegistry服务自动启动,资源监控时需要用到:
        sc config RemoteRegistry start= auto
8、 将LoadRunner的Agent添加到服务并自动启动:
        "%LoadRunner%\LAUNCH_SERVICE\bin\magentservice.exe" –install
9、 各测试机时间同步,可使用Windows的时间同步或第三方软件实现。笔者使用Linux的NTP服务。
10、 如果安装有防火墙,注意给LoadRunner放行。
11、 如果要进行Oracle的测试,还需要安装Oracle客户端。
12、 开启自动登录,运行`control userpasswords2`取消勾选“要使用本机,用户必须输入用户名和密码”(配合第13点,防止系统更新完成后自动重启)
13、 禁止系统更新自动重启功能:
        echo Yes | reg add HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoRebootWithLoggedOnUsers /t reg_Dword /d 1 /f

   测试环境:

Microsoft Windows Server 2003 R2 Enterprise Edition Service Pack 2 _ cn _ i386 (v5.2.3790)

HP LoadRunner Software 9.50.0.0 Build 3210

------------------ Linux ------------------

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”。

最简单的解决办法是不采用RSH连接,直接以服务方式运行即可。

补充一点,Linux下只能安装LoadRunner负载生成器。而且支持的协议相对Windows下要少很多。譬如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 .

 

0 0
原创粉丝点击