监控-添加Linux负载生成器
启动
不能使用root用户,启动负载生成器
cd /opt/HP/HP_LoadGenerator/bin
./m_daemon_setup start
ps aux | grep m_agent_daemon
安装
1、获取安装包,确认Linux是否安装c++,没有需要安装
2、安装compat-libstdc++时,报错
解决步骤 # yun install libgcc
重新安装compat-libstdc++ 仍然上述依赖关系。
重新 # yum install libgcc_s.so.1
再次安装改软件,依赖解决。通过之前两次安装的比较,arch 从x86_64变成了i686.
3、安装loadgenerator
- 使用root登录,先解压文件。也可以加压后放在系统中。# unzip LoadGenerator11.zip
- 进入加压出来的Linux文件夹,运行installer.sh文件。# cd .... # sh installer.sh
安装时如果报权限不足问题,可以给Linux下的所有文件授权 # chmod 777 -r linux/
- 再次进入Linux文件夹,运行安装脚本。直接按照提示下一步即可。举例:提示你是否继续安装,请输入n
4、安装后的环境配置
- 安装完成后,在/opt/HP/HP_LoadGenerator/会有一个env.csh。需要把它里面的环境变量加到.csh或.profile文件中。执行以下操作
vi /etc/csh.cshrc
在文件的最后加上
source /opt/HP/HP_LoadGenerator/env.csh
setenv DISPLAY 0.0
保存的时候使用:wq! -
如果是在linux,bash环境下,需要在root(本次是在etc下)目录找到.bashrc文件,添加以下内容:
Vi /etc/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 - 检查之前的配置是否成功,# env
5、创建用户
- loadgenerator 不能使用root用户运行。
- # useradd handan
- # su handan //切换用户
6、安装验证
- 进入/opt/HP/HP_LoadGenerator/bin/目录下
- ./verify_fenerator
说明安装成功
7、启动LR负载
- # cd /opt/HP/HP_LoadGenerator/bin
- #./m_daemon_setup start
如果成功的话会提示:m_agent_daemon (进程的PID ),
如果失败的话会提示:m_agent_daemon ( is down),
- 遇到is down 。检查tmp文件夹下的log,发现如下问题:
-
无法根据主机名称获取到IP. 检查当前的主机名称 # hostname
- #su root //切换到root 更改hosts配置 把查出来的主机名称指向127.0.0.1
- # vi /etc/hosts
按insert键,将当前的主机名称更改成之前查询出来的名称。如何更改请查询度娘。
8、回到普通用户下,启动LR负载。
显示了agent的进程编号,启动成功
连接
1、使用windows作为监控平台,添加Linux下的loadgenerator。
2、正常添加配置,注意在Unix environment选项卡下,勾选don't use RSH。
3、连接失败时,报错:
Failed to connect to the agent.
Load Generator not responding after timeout
Command line that was executed:
-usr dat/lr_trans_server.usr -controllerhost "desadmin" -bridge -monitor_parent -extra_ext time_diff_ext -no_exception -eve_file_version 3 -drv_log_file_under_cntrl lr_bridge.log -working_lang 0 -es_unique_id 11 -extra_ext SummaryDataTransExt -trans_server_extra_ext SummaryDataTransExt -trs_online_mode 0 -trs_timer_duration 5 -out_communication 0 -supply_netdir -extra_ext mft_server -lnch_priority normal -no_popups -lnch_interactive -lnch_registry_key "HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\LoadRunner\CurrentVersion\RuntimeEnvironment" -product_name "LoadRunner" -lnch_dont_remove_until_notify
或者Linux 下的tmp文件夹下log日志为;
Error: Communication error: Failed to bind socket while calling bind function. (sys error message - Permission denied) [MsgId: MERR-10344]
Error: Communication error: Failed to create a TCP server for the HTTP channel's server. (sys error message - Permission denied) [MsgId: MERR-10344]
Error: Two Way Communication Error: Function two_way_comm_create_acceptor failed. [MsgId: MERR-60999]Warning: Failed to create "router" server. [MsgId: MWAR-29974]
解决办法:root身份关闭防火墙
#service iptables stop