【无标题】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
相关推荐
爱吃青椒不爱吃西红柿‍️1 分钟前
华为ASP与CSP是什么?
服务器·前端·数据库
Yz987637 分钟前
hive的存储格式
大数据·数据库·数据仓库·hive·hadoop·数据库开发
苏-言1 小时前
Spring IOC实战指南:从零到一的构建过程
java·数据库·spring
Ljw...1 小时前
索引(MySQL)
数据库·mysql·索引
菠萝咕噜肉i1 小时前
超详细:Redis分布式锁
数据库·redis·分布式·缓存·分布式锁
长风清留扬1 小时前
一篇文章了解何为 “大数据治理“ 理论与实践
大数据·数据库·面试·数据治理
OpsEye1 小时前
MySQL 8.0.40版本自动升级异常的预警提示
数据库·mysql·数据库升级
Ljw...1 小时前
表的增删改查(MySQL)
数据库·后端·mysql·表的增删查改
远歌已逝4 小时前
维护在线重做日志(二)
数据库·oracle
qq_433099406 小时前
Ubuntu20.04从零安装IsaacSim/IsaacLab
数据库