【无标题】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
相关推荐
jnrjian4 小时前
Oracle datafile 数目限制是多少
数据库·oracle
卡布达ovo4 小时前
MongoDB入门
数据库·mongodb
Dnui_King4 小时前
Oracle SQL语句没有过滤条件,究竟是否会走索引??
数据库·sql·oracle
bug菌¹4 小时前
滚雪球学Oracle[3.4讲]:事务控制与锁管理
数据库·oracle·事务·事务控制·锁管理
数据最前线5 小时前
从DBA是“擦车的”谈起
数据库·dba
Wang's Blog5 小时前
Redis: 集群测试和集群原理
数据库·redis
bin91535 小时前
【EXCEL数据处理】000011 案列 EXCEL带有三角形图标的单元格转换,和文本日期格式转换。
大数据·数据库·信息可视化·数据挖掘·数据分析·excel·数据可视化
彭于晏6896 小时前
Android数据存储
android·数据库
Data 3176 小时前
Hive数仓操作(四)
大数据·数据库·数据仓库·hive·hadoop
wangyue46 小时前
MYSQL 乐观锁
数据库·mysql