最近在需要在云主机上进行压力测试,所以需要Linux的Agent。

一、安装:教程可以百度,大概步骤如下:

1、Upload Linux.zip to 指定的机器

2、解压,chmod 777 $Linux/installer.sh

3、执行Linux下的installer.sh (sudo权限)

按照提示安装下去即可。

注:安装完成后,在/opt/HP/HP_LoadGenerator/bin下所有目录及子目录均属于非root用户及非root用户组。如果出现文件夹为root用户组,文件为bin用户,则也会出现Not all extension Dlls were loaded的问题,需要重新安装。

二、环境变量配置(基于bsh)

1、在/opt/HP/HP_LoadGenerator/新增env.sh文件,内容如下:

#!/bin/bsh
export PRODUCT_DIR="/opt/HP/HP_LoadGenerator"
export M_LROOT="/opt/HP/HP_LoadGenerator"
export LD_LIBRARY_PATH=$M_LROOT/bin:$M_LROOT/lib:/usr/lib
export DISPLAY='0.0'
export PATH=$PATH:${M_LROOT}/bin

2、修改该文件的使用属性

chmod  env.sh

3、在环境变量中使用该文件,在/etc/profile 和/etc/bashrc 最后加入:

source /opt/HP/HP_LoadGenerator/env.sh

4、用户重新登陆,检查环境变量是否生效

echo $PRODUCT_DIR
echo $M_LROOT
echo $LD_LIBRARY_PATH
echo $PATH

5、执行/opt/HP/HP_LoadGenerator/bin/verify_generator

提示各种glibc缺失,需要自行安装。最特殊的是glibc++.so.5,需要手动单独安装。

特殊说明:此处提示${M_LROOT},${LD_LIBRART_PATH}找不到时,可以先忽略不管(前提步骤4的结果都正确)。

遇到的问题:

(1)/opt/HP/HP_LoadGenerator/bin/lrv/limithost: /opt/HP/HP_LoadGenerator/bin/lrv/chk_thread_lmt: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

sudo yum install glibc.i686

(2)/opt/HP/HP_LoadGenerator/bin/lrv/chk_thread_lmt: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
/opt/HP/HP_LoadGenerator/bin/lrv/limithost: line 134: [: : integer expression expected

sudo yum install libgcc-4.4.-.el6.i686.rpm

(3)/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

sudo yum install compat-libstdc++--3.2.-.el6.i686

6、关闭防火墙等其他安全通信策略

7、启动linux agent 进程(在/opt/HP/HP_LoadGenerator/bin/下)。成功后可以看到进程号,如果失败在/tmp下有个m_daemon***.log 文件去查看失败原因。

./m_daemon_setup start

(1)/tmp/m_daemon***.log出现如下报错:

// :: Error: Communication error: Failed to get the server host IP by calling the gethostbyname function.    [MsgId: MERR-]
// :: Error: Two Way Communication Error: Function two_way_comm_create_acceptor failed. [MsgId: MERR-]
// :: Error: Failed to create "launchservice" server. [MsgId: MERR-]
// :: Warning: Extension liblauncher.so reports error - on call to function ExtPerThreadInitialize [MsgId: MWAR-]
// :: Error: Vuser failed to initialize extension liblauncher.so. [MsgId: MERR-]
  • 先看下机器名称:
# hostname
  • 将上步骤获取的机器名称写入/etc/hosts中即可。

三、controller连接、场景试跑,报错:Not all extension Dlls were loaded

分析:开始以为本地Dll路径不对,百度一下,HP的论坛里这个问题很多人提问,但回答都说是linux agent的配置错误。

下面就回过头来看./verify_generator时产生的错误并彻底解决他们

1.${M_LROOT}找不到

解决 M_LROOT变量找不到的问题修改: /opt/HP/HP_LoadGenerator/bin/lrv/vusrchk中288行,将unset M_LROOT下移到289行后面

       my_shell="/bin/$my_shell"
else
temp=`$my_shell -c ' echo MERCURY ' > /dev/null`
if [ "$temp" = "MERCURY" ];then
echo "Failed $trail"
remote_install=
echo "_____Failed to run $my_shell. $trail"
exit
fi
fi
fi if [ $found_ksh != ]; then
ENV="$HOME/.profile"
export ENV
fi echo $ECHO_N "Verify \$M_LROOT ...$ECHO_C"
save_m_lroot="$M_LROOT"
#unset M_LROOT
temp=`$my_shell -c ' echo MERCURY $M_LROOT ' > /dev/null`
unset M_LROOT
new_m_lroot=`echo $temp | $SED -e 's/.*MERCURY[ ]*\(.*\)/\1/'` if [ "$new_m_lroot" = "" ]; then
echo "Failed $trail"
remote_install=
echo "_____It was not possible to set the \$M_LROOT from $trail"
echo "_____the shell dot files. One of several things might be happening: $trail"
echo "_____1) \$M_LROOT is not set at all in the shell dot files. $trail"
echo "_____2) There is some error in the shell dot files which stops their execution $trail"
echo "_____ before it sets \$M_LROOT. $trail"
echo "_____3) There is conditional code in the shell dot files (most likely related to $trail"
echo "_____ interactive and non interactive shells) and \$M_LROOT is set $trail"
echo "_____ only in one of the sections. $trail"
echo "_____Aborting virtual user tests on host `$HOSTNAME` $trail"

2、找不到${LD_LIBRARY_PATH}

解决LD_LIBRARY_PATH找不到的问题:将/opt/HP/HP_LoadGenerator/bin/lrv/vusrchk中356行,改成357行内容。

     case "$os_name" in
HP-UX)
temp=`$my_shell -c ' echo MERCURY $SHLIB_PATH ' > /dev/null`
;;
AIX)
temp=`$my_shell -c ' echo MERCURY $LIBPATH ' > /dev/null`
;;
SunOS|Linux)
#temp=`$my_shell -c ' echo MERCURY $LD_LIBRARY_PATH ' > /dev/null`
temp=`$my_shell -c ' echo MERCURY ${M_LROOT}/bin ' > /dev/null`
;;
esac

3、解决找不到libdriver.so的问题

Verify running the product executables...Failed
_____Failed to run the product executables.
_____Error:
mdrv: error while loading shared libraries: libdriver.so: cannot open shared object file: No such file or directory

(1)  先find下,看下libdriver.so所在目录

[work@presstest3 bin]$ find . -name "libdriver.so"
./libdriver.so
[work@presstest3 bin]$ pwd
/opt/HP/HP_LoadGenerator/bin

(2)将该路径加入/opt/HP/HP_LoadGenerator/bin/lrv/vusrchk 文件中

修改/opt/HP/HP_LoadGenerator/bin/lrv/vusrchk,在483行处再加入一次这个lib的路径:export  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/${M_LROOT}/bin

     echo $ECHO_N "Verify that the product executables are run from \$M_LROOT/bin...$ECHO_C"
which_mdrv=`$my_shell -c 'which mdrv' | $AWK '{which_mdrv=$0} END{print which_mdrv}'`
if [ "$which_mdrv" != "$PRODUCT_DIR/bin/mdrv" ]; then
wrong_path=`echo $which_mdrv | $SED -e 's/\/mdrv//'`
echo "Failed $trail"
remote_install=
echo "_____The product executables are run from $wrong_path $trail"
echo "_____and not from $PRODUCT_DIR/bin. $trail"
echo "_____Make sure that the PATH environment variable contains $trail"
echo "_____$PRODUCT_DIR/bin before $trail"
echo "_____$wrong_path. $trail"
exit
else
echo "OK $trail"
fi
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/${M_LROOT}/bin echo $ECHO_N "Verify running the product executables...$ECHO_C"
rm -f /tmp/verify_mdrv_err.txt
if [ $found_ksh != ]; then
$my_shell -c '(mdrv > /dev/null) 2> /tmp/verify_mdrv_err.txt' > /dev/null
else
$my_shell -c '(mdrv > /dev/null) >& /tmp/verify_mdrv_err.txt' > /dev/null
fi

至此./verfify_generator 已可以验证通过。

启动: ./m_daemon_setup start 执行成功。

四、再次使用Control验证“Not all extension Dlls were loaded”,该问题消失。

It work!~~~

五、总结:

M_LROOT、LD_LIBRARY_PATH和libdriver.so找不到,主要原因是LR提供的/opt /HP/HP_LoadGenerator/bin/lrv/vusrchk脚本中代码存在问题引起.写在这里,方便各位测试同仁遇到问题时不会无厘头的到处查问题,少走些弯路。当然我的代码中使用写死的办法完全是“头痛医头,脚痛医脚”的方法,后续有时间时会继续针对该代码进行调整,以解决代码通用性问题,欢迎各位点赞或拍砖!~

M_LROOT,LD_LIBRARY_PATH, “Not all extension Dlls were loaded”问题原因及解决方法(持续更新)的更多相关文章

  1. The address where a.out.debug has been loaded is missing以及No symbol "*" in current context原因与解决方法

    最近,在debug core的时候,发现p 变量的时候提示“No symbol "*" in current context”,我们的代码使用-g编译的,经查有可能是下列几个原因或 ...

  2. Linux yum提示Loaded plugins错误的解决方法

    yum是Linux软件包管理器,也叫yum源,在yum使用过程中,有时会出现Loaded plugins错误,重启无效,遇到这种情况该如何解决呢?下面就给大家介绍下Linux yum提示Loaded ...

  3. dyld: Library not loaded: @rpath/libswiftCore.dylib 解决方法

    解决: 设置Build Setting - > 搜索 embe关键字 -> 修改属性 见如下图: 如果更新了Xcode 8 这里变成:

  4. Eclipse 导入项目后启动报异常:java.lang.UnsatisfiedLinkError: Native Library *.dll already loaded in another classloade 解决方法

    tomcat 服务器的配置信息如下:

  5. Magento PHP Extension "curl" must be loaded解决方法

    我记得我第一次在xampp装magento的时候,进入后台时提示PHP Extension "curl" must be loaded 在网页上查了下原因和解决方法,发现是mage ...

  6. 【解决方法】You seem to have the current working directory in your LD_LIBRARY_PATH environment variable.

    参考地址:https://blog.csdn.net/qq_24755999/article/details/78722788 You seem to have the current working ...

  7. idea Plugin "Maven Integration Extension" was not loaded: required plugin "Maven Integration" is disabled

    由于自己运行了eclipse maven及idea maven 同时操作,可能产生了以上错误.既: idea  Plugin "Maven Integration Extension&quo ...

  8. PHP MySQLi extension is not loaded

    PHP MySQLi extension is not loaded 如何解决呢?  yum -y install mysqli.so  huozhe yum -y install php-mysql

  9. Module 'mysql' already loaded in Unknown on line 0解决方法

    Module 'mysql' already loaded in Unknown on line 0解决方法 直接进入php.ini 把;extension=mysql.so注释掉就好了

随机推荐

  1. 至芯FPGA培训中心-1天FPGA设计集训(赠送FPGA开发板)

    至芯FPGA培训中心-1天FPGA设计集训(赠送开发板) 开课时间2014年5月3日 课程介绍 FPGA设计初级培训班是针对于FPGA设计技术初学者的课程.课程不仅是对FPGA结构资源和设计流程的描述 ...

  2. 桌面小部件----LED电子时钟实现

    桌面控件是通过 Broadcast 的形式来进行控制的,因此每个桌面控件都对应于一个BroadcastReceiver.为了简化桌面控件的开发,Android 系统提供了一个 AppWidgetPro ...

  3. 利用ordered hints优化SQL

    SQL_ID  4g70n3k9bqc5v, child number 0 ------------------------------------- MERGE INTO YJBZH_GRXDFHZ ...

  4. HDOJ 1163 Eddy's digital Roots 九余数定理+简单数论

    我在网上看了一些大牛的题解,有些知识点不是太清楚, 因此再次整理了一下. 转载链接: http://blog.csdn.net/iamskying/article/details/4738838 ht ...

  5. 【动态规划】Codeforces 706C Hard problem

    题目链接: http://codeforces.com/contest/706/problem/C 题目大意: n(2 ≤ n ≤ 100 000)个字符串(长度不超过100000),翻转费用为Ci( ...

  6. 【索引】gtest学习笔记

    下载gtest 链接:http://www.cnblogs.com/duxiuxing/p/4270804.html gtest官方文档浅析 链接:http://www.cnblogs.com/dux ...

  7. 2013=12=2 bitree

    #include "stdio.h" #include "stdlib.h" #define OVERFLOW -1 #define ERROR -1 #def ...

  8. git init

    git clone git@code.easyunion.net:516059158/cloud-basic-knowledge.git添加codes;git add .;git commit -m ...

  9. 禁止UITextField 使用粘贴复制功能

    在开发中有时候会遇到这样的需求,就是一个文本框里面的内容不允许用户复制,或者不允许用户将其它地方复制的内容粘贴进来,本文交给你怎么实现禁止 UITextField 的粘贴.复制. 在 UITextFi ...

  10. UIAlertController 的使用(NS_CLASS_AVAILABLE_IOS(8_0)iOS8以后有效)

    iOS 8的新特性之一就是让接口更有适应性.更灵活,因此许多视图控制器的实现方式发生了巨大的变化.全新的UIPresentationController 在实现视图控制器间的过渡动画效果和自适应设备尺 ...