1. 在HP的官方網站上下載LoadRunner9.5 的Linux安裝程序[T7177-15009.iso],安裝文檔[hp_man_LRIG9.50_01_pdf.pdf]; html
安裝程序包括Hp、Ibm、Linux、Solaris系統的支持(LR9.0對應安裝文件爲[TLRNUX900WC_00.zip])。 c++
2. 安裝包的處理: bash
1. ZIP解壓:unzip TLRNUX900WC_00.zip oop
2. 掛載ISO:mkdir /mnt/LoadRunner ; mount -t iso9660 -o loop T7177-15009.iso /mnt/LoadRunner 網站
3. 開始安裝,以LR9.5爲例: ui
/mnt/LoadRunner/Linux/installer.sh spa
按提示操做,直接Next到完成。 .net
4. 添加用戶和環境變量: code
useradd -g 0 -s /bin/csh higkoo orm
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」。
補充,Linux下彷佛只支持Web/Http協議的腳本。譬如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 .
依賴庫:yum -y --disablerepo=\* --enablerepo=AutoInstaller --nogpgcheck --skip-broken localinstall /mnt/CentOS_Final/CentOS/compat-libstdc++-33-3.2.3-61.i386.rpm
不然會報:m_agent_daemon: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
注意hosts文件的配置,若是機器名和hosts裏配置不一致也會致使LoadRunner啓動失敗,
譬如:Error: Communication error: Failed to get the server host IP by calling the gethostbyname function.。
附上給LoadRunner定製的系統服務腳本(/etc/init.d/loadrunner):
UBIT="su - $USER -c "
$UBIT "cd $DIR && ./$DAEMON $ARGV"運行服務:
service loadrunner start
m_agent_daemon ( 1808 ),