M_LROOT,LD_LIBRARY_PATH, “Not all extension Dlls were loaded”问题原因及解决方法

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

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

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

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

3、执行Linux下的installer.sh

按照提示安装下去即可。

二、环境变量配置(基于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 777 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.7-11.el6.i686.rpm

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

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

./m_daemon_setup start

三、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行后面

269       my_shell="/bin/$my_shell"
270    else
271       temp=`$my_shell -c ‘ echo MERCURY ‘ 2> /dev/null`
272       if [ "$temp" = "MERCURY" ];then
273          echo "Failed $trail"
274          remote_install=1
275          echo "_____Failed to run $my_shell. $trail"
276          exit 1
277       fi
278    fi
279 fi
280
281 if [ $found_ksh != 0 ]; then
282    ENV="$HOME/.profile"
283    export ENV
284 fi
285
286 echo $ECHO_N  "Verify \$M_LROOT ...$ECHO_C"
287 save_m_lroot="$M_LROOT"
288 #unset M_LROOT
289 temp=`$my_shell -c ‘ echo MERCURY $M_LROOT ‘ 2> /dev/null`
290 unset M_LROOT
291 new_m_lroot=`echo $temp | $SED -e ‘s/.*MERCURY[ ]*\(.*\)/\1/‘`
292
293 if [ "$new_m_lroot" = "" ]; then
294         echo "Failed $trail"
295         remote_install=1
296         echo "_____It was not possible to set the \$M_LROOT from $trail"
297         echo "_____the shell dot files. One of several things might be happening: $trail"
298         echo "_____1) \$M_LROOT is not set at all in the shell dot files. $trail"
299         echo "_____2) There is some error in the shell dot files which stops their execution $trail"
300         echo "_____   before it sets \$M_LROOT. $trail"
301         echo "_____3) There is conditional code in the shell dot files (most likely related to $trail"
302         echo "_____   interactive and non interactive shells) and \$M_LROOT is set $trail"
303         echo "_____   only in one of the sections. $trail"
304         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行内容。

    348 case "$os_name" in
    349 HP-UX)
    350    temp=`$my_shell -c ‘ echo MERCURY $SHLIB_PATH ‘ 2> /dev/null`
    351    ;;
    352 AIX)
    353    temp=`$my_shell -c ‘ echo MERCURY $LIBPATH ‘ 2> /dev/null`
    354    ;;
    355 SunOS|Linux)
    356    #temp=`$my_shell -c ‘ echo MERCURY $LD_LIBRARY_PATH ‘ 2> /dev/null`
    357    temp=`$my_shell -c ‘ echo MERCURY ${M_LROOT}/bin ‘ 2> /dev/null`
    358    ;;
    359 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所在目录

[[email protected] bin]$ find . -name "libdriver.so"
./libdriver.so
[[email protected] 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

    469 echo $ECHO_N "Verify that the product executables are run from \$M_LROOT/bin...$ECHO_C"
    470 which_mdrv=`$my_shell -c ‘which mdrv‘ | $AWK  ‘{which_mdrv=$0} END{print which_mdrv}‘`
    471 if [ "$which_mdrv" != "$PRODUCT_DIR/bin/mdrv" ]; then
    472    wrong_path=`echo $which_mdrv | $SED -e ‘s/\/mdrv//‘`
    473    echo "Failed $trail"
    474    remote_install=1
    475    echo "_____The product executables are run from $wrong_path $trail"
    476    echo "_____and not from $PRODUCT_DIR/bin. $trail"
    477    echo "_____Make sure that the PATH environment variable contains $trail"
    478    echo "_____$PRODUCT_DIR/bin before $trail"
    479    echo "_____$wrong_path. $trail"
    480    exit 1
    481 else
    482   echo "OK $trail"
    483 fi
    484 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/${M_LROOT}/bin
    485
    486 echo $ECHO_N "Verify running the product executables...$ECHO_C"
    487 rm -f /tmp/verify_mdrv_err.txt
    488 if [ $found_ksh != 0 ]; then
    489    $my_shell -c ‘(mdrv > /dev/null) 2> /tmp/verify_mdrv_err.txt‘ > /dev/null
    490 else
    491    $my_shell -c ‘(mdrv > /dev/null) >& /tmp/verify_mdrv_err.txt‘ > /dev/null
    492 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脚本中代码存在问题引起.写在这里,方便各位测试同仁遇到问题时不会无厘头的到处查问题,少走些弯路。当然我的代码中使用写死的办法完全是“头痛医头,脚痛医脚”的方法,后续有时间时会继续针对该代码进行调整,以解决代码通用性问题,欢迎各位点赞或拍砖!~

时间: 2024-08-25 21:15:43

M_LROOT,LD_LIBRARY_PATH, “Not all extension Dlls were loaded”问题原因及解决方法的相关文章

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

yum是Linux软件包管理器,也叫yum源,在yum使用过程中,有时会出现Loaded plugins错误,重启无效,遇到这种情况该如何解决呢?下面就给大家介绍下Linux yum提示Loaded plugins错误的解决方法. 在linux中使用yum时出现如下错误: Loaded plugins: fastestmirror, security Existing lock /var/run/yum.pid: another copy is running as pid 4733. Anot

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

我记得我第一次在xampp装magento的时候,进入后台时提示PHP Extension "curl" must be loaded 在网页上查了下原因和解决方法,发现是magento环境里的php.ini文件配置问题 那么,首先,找到php.ini文件(别问我这文件在哪个目录下了,我真的想不起来了!!嗯!应该不难找) 打开php.ini文件搜索"php_curl.dll" 如果出现";extension=php_curl.dll" 把分号&q

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

由于自己运行了eclipse maven及idea maven 同时操作,可能产生了以上错误.既: idea  Plugin "Maven Integration Extension" was not loaded: required plugin "Maven Integration" is disabled 经过分析,是开发工具插件加载造成错误. 解决办法为:找到用户下使用工具地址: 原文地址:https://www.cnblogs.com/northeastT

Linux下使用Python连接Oracle 报cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded解决方法

在Linux上使用python运行数据库脚本的时候报:cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded解决方法 这个导致这个问题的原因是本机的Python2.7是64位的,而数据库用了32位的instantclient-basic,所以要把instantclient-basic的版本更新为64位的 以下是按照官网文档操作的,自测没有问题. 下载instantclient-basic的R

win7 64位系统 PB连接oracle数据库出现“oracle library oci.dll could not be loaded”问题的解决方法

今天与大家分享一个自己的学习笔记,希望能给遇到同样问题的人带来帮助. 不知道大家在win7 64位系统下用 PB连接oracle数据库时,是否遇到过“oracle library oci.dll could not be loaded”问题. 今天,在win7 64位系统下用 PB连接oracle数据库时,一直出现上述错误,在百度上找了很久,都没有找到一个完整的解决方案,咨询了很多人,(他们都说是我的PB和oracle没装好,但我装的时候没出现任何问题,一切都很顺利,而且PB和oracle都能正

PHP提示Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法

这篇文章主要介绍了PHP提示Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法,是在进行PHP数据库程序开发中常会遇到的错误,需要的朋友可以参考下 本文实例讲述了PHP提示 Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法,在PHP程序开发中常会遇到这类问题.分享给大家供大家参考,具体的解决方法如下: 将下面代码改为mysqli

Python包的相对导入时出现“ ‘Parent module ' not loaded, cannot perform relative import”的解决方法

在练习Python中package的相对导入时,即 from . import XXX 或者 from .. import XXX 时会遇到这样两个错误: SystemError: Parent module '' not loaded, cannot perform relative import 和 ValueError: attempted relative import beyond top-level package 其实这两个错误的原因归根结底是一样的:在涉及到相对导入时,packa

PHP Warning: Module 'modulename' already loaded in Unknown on line 0 的解决方法

今天无间断服务加载php-fpm时,爆出了一个错误:PHP Warning:  Module 'xhprof' already loaded in Unknown on line 0 <br /> 从英文可以看出PHP的扩展xhprof已经加载了,所以就查看php.ini,搜索xhprof.so发现有两个,删除其中一个,然后无间断服务加载php-fpm就解决了该问题. PHP Warning: Module 'modulename' already loaded in Unknown on l

Interactive Reporting , SQL*Net not loaded successfully 问题的解决。

.bashrc 什么的,早就把 TNS_ADMIN , 和 LD_LIBRARY_PATH 加进去了,可就是不好使. 终极方法还是在 workspace 的 R&A -> Services 里设置属性. LD_LIBRARY_PATH=/home/julian/app/julian/product/11.2.0/client_3/lib:/home/julian/app/julian/product/11.2.0/client_3/network/lib TNS_ADMIN=/home/ju