【无标题】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
相关推荐
heart000_14 小时前
MySQL事务与锁机制详解:确保数据一致性的关键【MySQL系列】
数据库·mysql
一眼青苔4 小时前
MySQL 如何判断某个表中是否存在某个字段
数据库·mysql
西柚小萌新4 小时前
【大模型:知识图谱】--3.py2neo连接图数据库neo4j
数据库·知识图谱·neo4j
wangfenglei1234565 小时前
mybatis打印完整的SQL,p6spy
数据库·sql·mybatis
__风__5 小时前
PostgreSQL ERROR: out of shared memory处理
数据库·postgresql
占星安啦5 小时前
一个html实现数据库自定义查询
java·前端·javascript·数据库·动态查询
天空之城夢主5 小时前
MySQL 全量、增量备份与恢复
数据库·mysql·oracle
Elastic 中国社区官方博客5 小时前
连接关键点:使用 ES|QL 联接实现更丰富的可观测性洞察
大数据·数据库·sql·elasticsearch·搜索引擎·全文检索
元闰子5 小时前
AI Agent需要什么样的数据库?
数据库·人工智能·后端
什么都想学的阿超5 小时前
【PostgreSQL 02】PostgreSQL数据类型革命:JSON、数组与地理信息让你的应用飞起来
数据库·postgresql·json