本文内容来自 YashanDB 官网,原文内容请见 https:///newsinfo/7610142.html?templateId=1718516
问题场景
数据库正常运行,使用 yasboot 关闭数据库并重启服务器后,用 yasboot 启动 yasom,yasagent 以及 yasdb 进程成功,但是 yasom,yasagent 存在告警
告警详情
warning: watch yasom error: monitor failed, stdout: , /data/yashan/yasdb_home/yashandb/22.2.8.105/bin/moint/moint: error while loading shared libraries: libnsl.so.1: cannot open shared object file: no such file or directory
warning: watch yasagent error: monitor failed, stdout: , /data/yashan/yasdb_home/yashandb/22.2.8.105/bin/moint/moint: error while loading shared libraries: libnsl.so.1: cannot open shared object file: no such file or directory
问题原因
数据库 monit 进程依赖于 libnsl.so.1 库文件,告警中的提示信息为在 LD_LIBRARY_PATH 下找不到 libnsl.so.1
排查步骤
1、检查系统中 libnsl.so.1 文件是否存在
ldconfig -p | grep libnsl
2、若不存在,可以通过以下方式安装
若操作系统为 Red Hat、CentOS、Fedora 等使用命令: $ yum install libnsl
若操作系统为 Debian、Ubuntu 等使用命令:$ apt update && apt-get -y install rpm && rpm -ivh libnsl-2.28-164.el8.aarch64.rpm --nodeps
检查是否存在 libnsl.so.2,若存在则可以创建 libnsl.sl.1 的符号链接到 libnsl.so.2
$ cd /lib64
$ ln -s libnsl.so.2.0.0 libnsl.so.1
若存在,则可能是库文件环境变量不对
执行 vi ~/.bashrc 添加:export LB_LIBRARY_PATH=$YASDB_HOME/lib:$LD_LIBRARY_PATH
source ~/.bashrc
3、重新执行 yasom 和 yasagent 进程启动命令可查看问题是否解决:
yasboot process yasom start -c yashandb
yasboot process yasagent start -c yashandb
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70028812/viewspace-3071698/ ,如需转载,请注明出处,否则将追究法律责任。