首页 > 系统相关 >Linux下安装lr负载机

Linux下安装lr负载机

时间:2022-12-20 18:05:40浏览次数:42  
标签:负载 04 33 daemon c++ loadrunner lr Linux libstd

负载代理下载地址

load-generator

链接:https://pan.baidu.com/s/1qcFNZXGdegzYJovOKgj2CA
提取码:ed55

安装环境

系统:centos7最小安装版(CentOS-7-x86_64-Minimal-1503-01.iso)。 
[root@centos1 tmp]# lsb_release -a 
LSB Version: :core-4.1-amd64:core-4.1-noarch 
Distributor ID: CentOS 
Description: CentOS Linux release 7.1.1503 (Core) 
Release: 7.1.1503 
Codename: Core 
[root@centos1 tmp]# uname -a 
Linux centos1 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

安装过程

上传

将下载的loadrunner-11-load-generator.iso文件上传到linux的/opt目录下(目录可自行决定,不过安装后默认是安装在/opt/HP/HP_LoadGenerator下,因此我直接放在这个目录下,以下命令均以此目录为例)

挂载

cd /opt 
mkdir iso #注意,创建一个之前不存在的目录即可,作为镜像文件的挂载点 
mount -o loop loadrunner-11-load-generator.iso iso/

安装

预先安装perl 
yum install perl

cd iso/Linux 

./installer.sh 

1、输入n,继续安装 

Linux下安装lr负载机_bash

 

2、输入a,同意协议 

Linux下安装lr负载机_bash_02

 

3、输入i,直接安装 

Linux下安装lr负载机_libstdc++_03

 

4、输入f,完成安装 

Linux下安装lr负载机_centos_04

创建运行用户并配置环境变量

不知道为什么要创建运行用户,可能是为了安全考虑。 
1、创建用户 
useradd -g 0 -s /bin/bash loadrunner 
注意:这里用户名可以自行定义,使用bash或csh也都可以,只不过配置略有不同,以下以bash配置方式为例,在最后说明csh的配置方式。 
2、创建配置文件 
cd /opt/HP/HP_LoadGenerator 
vim env.sh

#/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:/usr/lib64
export DISPLAY='0.0'
export PATH=$PATH:$M_LROOT/bin

保存并退出。 
3、将配置文件加载到/etc/profile中,以便开机、切换用户时都能自动加载: 
vim /etc/profile 
添加如下内容:

source /opt/HP/HP_LoadGenerator/env.sh

保存并退出。 

4、退出当前shell并重新连接,切换loadrunner用户并查看环境变量 

su loadrunner 

env 

Linux下安装lr负载机_bash_05

启动

cd /opt/HP/HP_LoadGenerator/bin 
./m_daemon_setup start

问题1:

[loadrunner@localhost bin]$ ./m_daemon_setup start
./m_daemon_setup: ./m_agent_daemon: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

【解决】:yum install glibc.i686 
问题2:

[loadrunner@localhost bin]$ ./m_daemon_setup start
m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

【解决思路】: 
yum install libstdc++.i686* 
find / -name libstdc++.so* 
找到发现有libstdc++.so.5,在/usr/lib64/libstdc++.so.5中; 
修改上面的LD_LIBRARY_PATH,添加:/usr/lib64

问题3:

[loadrunner@centos1 bin]$ ./m_daemon_setup start
m_agent_daemon: error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS64

【解决思路】: 
查看发现是由于版本不对,64位的libstdc++.so.5不适用,应该安装32位的,所以把上一步的操作还原,然后执行yum whatprovides libstdc++.so.5,查看到该动态库是compat-libstdc++-33-3.2.3-72.el7.i686提供,因此执行yum install compat-libstdc++-33-3.2.3-72.el7.i686安装。

问题4:

[loadrunner@centos1 bin]$ ./m_daemon_setup start
m_agent_daemon ( is down ),

【解决思路】: 
没有提示信息,只有直接查看日志了: 
vim /tmp/m_agent_daemonTihVLp.log

DriverLogger: Log started at 21/04/2016 06:33:04 .

21/04/2016 06:33:04 Error: Communication error: Failed to get the server host IP by calling the gethostbyname function. (sys error message - Resource temporarily unavailable) [MsgId: MERR-10344]
21/04/2016 06:33:04 Error: Two Way Communication Error: Function two_way_comm_create_acceptor failed. [MsgId: MERR-60999]
21/04/2016 06:33:04 Error: Failed to create "launchservice" server. [MsgId: MERR-29974]
21/04/2016 06:33:04 Warning: Extension liblauncher.so reports error -1 on call to function ExtPerThreadInitialize [MsgId: MWAR-10485]
21/04/2016 06:33:04 Error: Vuser failed to initialize extension liblauncher.so. [MsgId: MERR-10700]

DriverLogger: Log ended at

保存并退出。 
3、将配置文件加载到/etc/profile中,以便开机、切换用户时都能自动加载: 
vim /etc/profile 
添加如下内容:

source /opt/HP/HP_LoadGenerator/env.sh

保存并退出。 

4、退出当前shell并重新连接,切换loadrunner用户并查看环境变量 

su loadrunner 

env 

Linux下安装lr负载机_bash_05

启动

cd /opt/HP/HP_LoadGenerator/bin 
./m_daemon_setup start

问题1:

[loadrunner@localhost bin]$ ./m_daemon_setup start
./m_daemon_setup: ./m_agent_daemon: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

【解决】:yum install glibc.i686 
问题2:

[loadrunner@localhost bin]$ ./m_daemon_setup start
m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

【解决思路】: 
yum install libstdc++.i686* 
find / -name libstdc++.so* 
找到发现有libstdc++.so.5,在/usr/lib64/libstdc++.so.5中; 
修改上面的LD_LIBRARY_PATH,添加:/usr/lib64

问题3:

[loadrunner@centos1 bin]$ ./m_daemon_setup start
m_agent_daemon: error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS64

【解决思路】: 
查看发现是由于版本不对,64位的libstdc++.so.5不适用,应该安装32位的,所以把上一步的操作还原,然后执行yum whatprovides libstdc++.so.5,查看到该动态库是compat-libstdc++-33-3.2.3-72.el7.i686提供,因此执行yum install compat-libstdc++-33-3.2.3-72.el7.i686安装。

问题4:

[loadrunner@centos1 bin]$ ./m_daemon_setup start
m_agent_daemon ( is down ),

【解决思路】: 
没有提示信息,只有直接查看日志了: 
vim /tmp/m_agent_daemonTihVLp.log

DriverLogger: Log started at 21/04/2016 06:33:04 .

21/04/2016 06:33:04 Error: Communication error: Failed to get the server host IP by calling the gethostbyname function. (sys error message - Resource temporarily unavailable) [MsgId: MERR-10344]
21/04/2016 06:33:04 Error: Two Way Communication Error: Function two_way_comm_create_acceptor failed. [MsgId: MERR-60999]
21/04/2016 06:33:04 Error: Failed to create "launchservice" server. [MsgId: MERR-29974]
21/04/2016 06:33:04 Warning: Extension liblauncher.so reports error -1 on call to function ExtPerThreadInitialize [MsgId: MWAR-10485]
21/04/2016 06:33:04 Error: Vuser failed to initialize extension liblauncher.so. [MsgId: MERR-10700]

DriverLogger: Log ended at

标签:负载,04,33,daemon,c++,loadrunner,lr,Linux,libstd
From: https://blog.51cto.com/u_14181351/5956381

相关文章