【无标题】observer: error while loading shared libraries: libmariadb.so.3处理办法

文章目录

1.记录新装的oceanbase,使用observer帮助时,出现lib文件无法找到的处理过程

bash 复制代码
./observer --help
./observer: error while loading shared libraries: libmariadb.so.3: cannot open shared object file: No such file or directory

2.做一个strace跟踪,发现是某些lib文件无法找到

bash 复制代码
 strace ./observer 

输出截取如下:

bash 复制代码
openat(AT_FDCWD, "/usr/lib/libmariadb.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
writev(2, [{iov_base="./observer", iov_len=10}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libmariadb.so.3", iov_len=15}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10./observer: error while loading shared libraries: libmariadb.so.3: cannot open shared object file: No such file or directory
) = 125
exit_group(127)                         = ?
+++ exited with 127 +++
obadmin@obsrv01:~/myoceanb

4.使用ldd查看observer依赖的lib库文件,结果有libmariadb.so.3,libaio.so.1两个文件是not found

bash 复制代码
obadmin@obsrv01:~/myoceanbase/oceanbase/bin$ ldd ./observer
        linux-vdso.so.1 (0x00007ffd27bdb000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff1f16cd000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff1f16c8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff1f15df000)
        libmariadb.so.3 => not found
        libaio.so.1 => not found 
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff1f15d8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff1c7a00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff1f16da000)

5.使用find查找文件时,发现oceanbase的lib库文件夹实际上有这个文件

bash 复制代码
 sudo find / -name libmariadb.so.3
/home/obadmin/.obd/repository/oceanbase-ce-libs/4.3.1.0/68f0b5f988bd5fb80d44ac29afad0c2b2f2d3763/libmariadb.so.3
/home/obadmin/myoceanbase/oceanbase/lib/libmariadb.so.3

6.使用ls确认,libmariadb与libaio两个文件都在/home/obadmin/myoceanbase/oceanbase/lib/文件夹下

bash 复制代码
 ls /home/obadmin/myoceanbase/oceanbase/lib/libmariadb.so /home/obadmin/myoceanbase/oceanbase/lib/libaio.so.1.0.1
/home/obadmin/myoceanbase/oceanbase/lib/libaio.so.1.0.1
/home/obadmin/myoceanbase/oceanbase/lib/libmariadb.so

7.查询$LD_LIBRARY_PATH,结果返回空值

bash 复制代码
echo $LD_LIBRARY_PATH

8.设置LD_LIBRARY_PATH

bash 复制代码
export LD_LIBRARY_PATH=/home/obadmin/myoceanbase/oceanbase/lib

9.再次查询LD_LIBRARY_PATH变量,这回有值了

bash 复制代码
 echo $LD_LIBRARY_PATH
/home/obadmin/myoceanbase/oceanbase/lib

10.再次运行observer

bash 复制代码
 ./observer --help
./observer --help
observer [OPTIONS]
  -h,--help                print this help
  -z,--zone ZONE           zone
  -p,--mysql_port PORT     mysql port
  -P,--rpc_port PORT       rpc port
  -N,--nodaemon            don't run in daemon
  -n,--appname APPNAME     application name
  -c,--cluster_id ID       cluster id
  -d,--data_dir DIR        OceanBase data directory
  -i,--devname DEV         net dev interface
  -I,--local_ip            ip of the current machine
  -o,--optstr OPTSTR       extra options string
  -r,--rs_list RS_LIST     root service list
  -l,--log_level LOG_LEVEL server log level
  -6,--ipv6 USE_IPV6       server use ipv6 address
  -m,--mode MODE server mode
  -f,--scn flashback_scn
相关推荐
woshilys28 分钟前
sql server 查询对象的修改时间
运维·数据库·sqlserver
Hacker_LaoYi28 分钟前
SQL注入的那些面试题总结
数据库·sql
建投数据1 小时前
建投数据与腾讯云数据库TDSQL完成产品兼容性互认证
数据库·腾讯云
Hacker_LaoYi2 小时前
【渗透技术总结】SQL手工注入总结
数据库·sql
岁月变迁呀2 小时前
Redis梳理
数据库·redis·缓存
独行soc2 小时前
#渗透测试#漏洞挖掘#红蓝攻防#护网#sql注入介绍06-基于子查询的SQL注入(Subquery-Based SQL Injection)
数据库·sql·安全·web安全·漏洞挖掘·hw
你的微笑,乱了夏天3 小时前
linux centos 7 安装 mongodb7
数据库·mongodb
工业甲酰苯胺3 小时前
分布式系统架构:服务容错
数据库·架构
独行soc4 小时前
#渗透测试#漏洞挖掘#红蓝攻防#护网#sql注入介绍08-基于时间延迟的SQL注入(Time-Based SQL Injection)
数据库·sql·安全·渗透测试·漏洞挖掘
White_Mountain5 小时前
在Ubuntu中配置mysql,并允许外部访问数据库
数据库·mysql·ubuntu