1、安装 解压文件后,将Linux文件一起传到linux上 chmod -R +x Linux/*(要会提示一些文件没有执行权限) ./install.sh 一路按提示操作 加一个用户(默认这个东西不让使用root运行,如果有其他非root用户,理论上也可以) useradd -g 0 -s /bin/bash xiaoqiang
2、设置环境变量 vi /root/.bashrc 然后添加下面的东东: Bash shell执行:
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
3、查看自己的host文件中有没有127.0.0.1和本机名对应的哪一行,如果没有,则加上,否则会报错——貌似忽略不管也行 vi /etc/hosts 加一行
[puyitou@VM_74_235_centos ~]$ cd /opt/HP/HP_LoadGenerator/bin
[puyitou@VM_74_235_centos bin]$ ./verify_generator
Environment variable M_LROOT must be set to the product directory
in order for verify_generator to execute.
Please setenv/export (csh/sh) it and run verify_generator again
解决方案:在bash下安装,可以在HP_LoadGenerator 下建立一个 env.sh文件,文件内容如下,再将该文件 引入到 /etc/profile 的最后一行。
#/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
切换到root用户下,[root@VM_74_235_centos ~]# cd /opt/HP/HP_LoadGenerator/
[root@VM_74_235_centos HP_LoadGenerator]# vi 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
export DISPLAY='0.0'
export PATH=$PATH:$M_LROOT/bin
~
"env.sh" [New] 11L, 198C written
[root@VM_74_235_centos HP_LoadGenerator]# vi /etc/profile
在最后加上: source /opt/HP/HP_LoadGenerator/env.sh
[root@VM_74_235_centos HP_LoadGenerator]# echo bash
bash
[root@VM_74_235_centos HP_LoadGenerator]# su - puyitou
[puyitou@VM_74_235_centos ~]$ cd /opt/HP/HP_LoadGenerator/bin
[puyitou@VM_74_235_centos bin]$ ./verify_generator
===================================================
HP
Vuser Environment Verification Utility
===================================================
Product: LoadRunner 11.0
Version: 11.0.0.8866
Build: 8866
VM_74_235_centos:
/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
Warning: The file .rhosts does not exist in the home directory of the user.
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 VM_74_235_centos
verify_generator...OK
_______________________________________________
Summary:
________
Vuser Host VM_74_235_centos: Failed
[yiqitou@VM_50_93_centos 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
m_agent_daemon ( is down ),
解决方案:[yiqitou@VM_50_93_centos bin]$ yum whatprovides libstdc++.so.5
Loaded plugins: fastestmirror, security
Determining fastest mirrors
centosplus | 3.4 kB 00:00
centosplus/primary_db | 1.7 MB 00:00
contrib | 2.9 kB 00:00
contrib/primary_db | 1.2 kB 00:00
cr | 2.9 kB 00:00
cr/primary_db | 1.2 kB 00:00
epel | 4.4 kB 00:00
epel/primary_db | 6.2 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 19 kB 00:00
fasttrack | 3.4 kB 00:00
fasttrack/primary_db | 85 kB 00:00
os | 3.7 kB 00:00
os/primary_db | 4.4 MB 00:00
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 2.7 MB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.7 MB 00:00
compat-libstdc++-33-3.2.3-69.el6.i686 : Compatibility standard C++ libraries
Repo : os
Matched from:
Other : libstdc++.so.5
[yiqitou@VM_50_93_centos bin]$ yum install compat-libstdc++-33-3.2.3-69.el6.i686
Loaded plugins: fastestmirror, security
You need to be root to perform this command.
切换到root用户下安装,安装完成后,切换回yiqitou用户
[root@VM_50_93_centos bin]# su - yiqitou
[yiqitou@VM_50_93_centos ~]$ cd /opt/HP/HP_LoadGenerator/bin
[yiqitou@VM_50_93_centos bin]$ ./m_daemon_setup start
m_agent_daemon ( 4655 ),
另外一台服务器启动后,提示:
[puyitou@VM_74_236_centos bin]$ ./m_daemon_setup start
m_agent_daemon ( is down ),
解决方案:切换到root用户,查看自己的host文件中有没有127.0.0.1和本机名对应的哪一行,如果没有,则加上
[root@VM_74_236_centos ~]# vi /etc/hosts
127.0.0.1 TENCENT64.site TENCENT64
10.232.74.236 VM_74_236_centos
重新切换到puyitou用户启动:
[root@VM_74_236_centos ~]# su - puyitou
[puyitou@VM_74_236_centos ~]$ cd /opt/HP/HP_LoadGenerator/bin
[puyitou@VM_74_236_centos bin]$ ./m_daemon_setup start
m_agent_daemon ( 23679 ),
启动成功
卸载:
执行/var/opt/HP/iHP/HP_LoadGenerator/9.50.000/installer.sh
按提示操作。即可卸载成功。
(忽略用户)