Linux下安裝LoadRunner(LoadGenerator)
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”。
補充,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):
# /etc/init.d/loadrunner
# Loadrunner負載生成器服務
DAEMON=m_daemon_setup
ARGV="$@"
DIR=/opt/HP/HP_LoadGenerator/bin/
USER=higkoo
UBIT="su - $USER -c "
$UBIT "cd $DIR && ./$DAEMON $ARGV"運行服務:
service loadrunner start
m_agent_daemon ( 1808 ),