Nagios显示器mysql定从库: libmysqlclient.so.18: cannot open shared object file: No such
error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
1,错误信息例如以下:
[root@slave ~]# /usr/local/nagios/libexec/check_mysql -uadmin -P3306 -S /data/mbdata/open/mysql.sock -H127.0.0.1 -pxxxxx -d openshop -w 300 -c 360
/usr/local/nagios/libexec/check_mysql: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
[root@slave ~]#
2,运行check_mysql --help看下命令,发现也不行。
[root@slave ~]# /usr/local/nagios/libexec/check_mysql --help
/usr/local/nagios/libexec/check_mysql: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
[root@slave ~]#
3。查看一下报错的libmysqlclient.so.18文件是否存在:
[root@db-m1-slave-1 ~]# find / -name libmysqlclient.so.18
/mysql-5.6.12/libmysql/libmysqlclient.so.18
/usr/local/mysql/lib/libmysqlclient.so.18
文件存在。可是无法识别。
4,可能是libmysqlclient的问题
搜索mysqlclient library linkage problem。
找到文章地址:http://stackoverflow.com/questions/2080679/mysqlclient-library-linkage-problem
发现有/etc/ld.so.conf.d/mysql-x86_64.conf这样一个配置文件,打开看看
cat /etc/ld.so.conf.d/mysql-x86_64.conf
[root@slave ~]# cat /etc/ld.so.conf.d/mysql-x86_64.conf
/usr/lib64/mysql
进入文件夹/usr/lib64/mysql查看下有什么文件:
[root@slave ~]# ll /usr/lib64/mysql
总用量 3108
lrwxrwxrwx. 1 root root      26 9月  29 2013 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
-rwxr-xr-x. 1 root root 1595176 12月  8 2012 libmysqlclient_r.so.16.0.0
lrwxrwxrwx. 1 root root      24 9月  29 2013 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
-rwxr-xr-x. 1 root root 1582952 12月  8 2012 libmysqlclient.so.16.0.0
有一些软连接。并且带了后缀表示so.16之类的。可是没有so.18之类,看来是没有连接到这里,
可能是须要做一个软连接把/usr/local/mysql/lib/libmysqlclient.so.18变成/usr/lib64/libmysqlclient.so.18,
立即去做软连接:ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18,然后再check下。check成功例如以下所看到的:
[root@slave ~]# ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
[root@slave ~]#
[root@slave ~]#
[root@slave ~]# /usr/local/nagios/libexec/check_mysql --help
check_mysql v2.0 (nagios-plugins 2.0)
Copyright (c) 1999-2014 Nagios Plugin Development Team
<devel@nagios-plugins.org>
This program tests connections to a MySQL server
Usage:
check_mysql [-d database] [-H host] [-P port] [-s socket]
[-u user] [-p password] [-S] [-l] [-a cert] [-k key]
[-C ca-cert] [-D ca-dir] [-L ciphers] [-f optfile] [-g group] Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See
https://www.nagios-plugins.org/doc/extra-opts.html
for usage and examples.
..................................
-l, --ssl
Use ssl encryptation
-C, --ca-cert=STRING
Path to CA signing the cert
-a, --cert=STRING
Path to SSL certificate
-k, --key=STRING
Path to private SSL key
-D, --ca-dir=STRING
Path to CA directory
-L, --ciphers=STRING
List of valid SSL ciphers
.................................................
Send email to help@nagios-plugins.org if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
devel@nagios-plugins.org [root@slave ~]#
5,继续运行check_mysql来check一下
[root@slave ~]# /usr/local/nagios/libexec/check_mysql -unagios -P3306 -S -H127.0.0.1 --password='xxx@0512' /usr/local/mysql/mysql.sock -d test -w 60 -c 100
slave query error: Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation
[root@slave ~]# 
报账号错误,
check
slave query error: Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation
账号错误,进入mysql界面赋予nagios账号权限
mysql> GRANT PROCESS, SUPER, REPLICATION CLIENT ON *.* TO nagios@'%' identified by 'xxx@0512';
6。再check
[root@slave ~]# /usr/local/nagios/libexec/check_mysql -unagios -P3306 -S -Hlocalhost --password='xxx@0512' -s /usr/local/mysql/mysql.sock -d test -w 60 -c 100
Slave IO: Yes Slave SQL: No Seconds Behind Master: (null)
mysql slave 检測失败。有错误信息:Slave IO: Yes Slave SQL: No Seconds Behind Master: (null)
进mysql窗体去看具体信息
[root@slave ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.6.12-log Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.xx.3.xx
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.010294
Read_Master_Log_Pos: 21764
Relay_Log_File: mysql-relay-bin.003125
Relay_Log_Pos: 91805
Relay_Master_Log_File: mysql-bin.010275
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB: xx,xx_db,xxsystem
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1590
Last_Error: The incident LOST_EVENTS occured on the master. Message: error writing to the binary log
Skip_Counter: 0
Exec_Master_Log_Pos: 91642
Relay_Log_Space: 1780004
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1590
Last_SQL_Error: The incident LOST_EVENTS occured on the master. Message: error writing to the binary log
Replicate_Ignore_Server_Ids:
Master_Server_Id: 71
Master_UUID: 9b0dcf62-29f4-11e3-9471-677b33903869
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 140512 11:29:54
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
mysql>
关于Slave IO: Yes Slave SQL: No Seconds Behind Master: (null),參考blog: http://blog.csdn.net/mchdba/article/details/25738991
7,slave重做之后,再check,slave状态是正常的。
# /usr/local/nagios/libexec/check_mysql -unagios -P3306 -S -s /usr/local/mysql/mysql.sock -Hlocalhost --password='xxx@0512' -d test -w 60 -c 100
[root@slave ~]# /usr/local/nagios/libexec/check_mysql -unagios -P3306 -S -s /usr/local/mysql/mysql.sock -Hlocalhost --password='xxx@0512' -d test -w 60 -c 100
Uptime: 18431321 Threads: 3 Questions: 1447646 Slow queries: 735 Opens: 18605 Flush tables: 1 Open tables: 214 Queries per second avg: 0.078 Slave IO: Yes Slave SQL: Yes Seconds Behind Master: 0|Connections=1380c;;; Open_files=32;;; Open_tables=214;;; Qcache_free_memory=66980240;;; Qcache_hits=778c;;; Qcache_inserts=5338c;;; Qcache_lowmem_prunes=0c;;; Qcache_not_cached=12516c;;; Qcache_queries_in_cache=34;;; Queries=1447647c;;; Questions=99727c;;; Table_locks_waited=0c;;; Threads_connected=1;;; Threads_running=1;;; Uptime=18431321c;;; 'seconds behind master'=0.000000s;60.000000;100.000000;
[root@db-m1-slave-1 ~]#
版权声明:本文博主原创文章。博客,未经同意不得转载。
Nagios显示器mysql定从库: libmysqlclient.so.18: cannot open shared object file: No such的更多相关文章
- libmysqlclient.so.18: cannot open shared object file
		
libmysqlclient.so.18: cannot open shared object file 解决libmysqlclient.so.18: cannot open shared obje ...
 - error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
		
zabbix3.2启动有如下报错: # service zabbix_server startStarting zabbix_server: /home/zabbix-server/sbin/zab ...
 - 发生服务器错误: Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory
		
在hue上配置Mysql的时候,出现的错误: 发生服务器错误: Error loading MySQLdb module: libmysqlclient.so.18: cannot open sha ...
 - 报错:/application/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
		
启动zabbix_server时报错: /application/zabbix/sbin/zabbix_server: error while loading shared libraries: li ...
 - Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory
		
在hue上配置Mysql的时候,出现的错误: 发生服务器错误: Error loading MySQLdb module: libmysqlclient.so.18: cannot open sha ...
 - libmysqlclient.so.16: cannot open shared object file: No such file or directory
		
编译安装的mysql5.6.39,安装目录是/usr/local/mysql,启用程序时报错:libmysqlclient.so.16: cannot open shared object file: ...
 - ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory  解决办法
		
>>> import MySQLdbTraceback (most recent call last): File "<stdin>", line ...
 - Hue - Error loading MySQLdb module: libmysqlclient.so.20: cannot open shared object file: No such file or
		
解决下面两点异常 >> 1. Hue页面 点击DB 查询时弹出: Error loading MySQLdb module: libmysqlclient.so.20: cannot op ...
 - libmysqlclient.so.15: cannot open shared object file: No such file or directory
		
错误: ./mafsInRegion: error while loading shared libraries: libmysqlclient.so.15: cannot open shared o ...
 
随机推荐
- zoj2314(有上下界的网络流)
			
传送门:Reactor Cooling 题意:给n个点,及m根pipe,每根pipe用来流躺液体的,单向的,每时每刻每根pipe流进来的物质要等于流出去的物质,要使得m条pipe组成一个循环体,里面流 ...
 - shortcut switch in terminal start pos & end pos
			
ctrl a ctrl e switch in terminal start pos & end pos
 - Shell简易学习练习
			
1.Linux Shell入门 Quiz 1 一个接受命令行参数的shell脚本 任务 编写一个shell脚本1.sh,这个脚本接受一个命令行参数,并把这个参数打印两次到标准输出. 如果输入没有参数输 ...
 - APPCAN学习笔记001---app高速开发AppCan.cn平台概述
			
1.APPCAN学习笔记---app高速开发AppCan.cn平台概述 1. 平台概述 技术qq交流群:JavaDream:251572072 AppCan.cn开发平台是基于HTML5技术的跨平台移 ...
 - Error : APP-FND-01926: The custom event WHEN-LOGON-CHANGED raised unhandled exception: ORA-06502: PL
			
In this Document _afrLoop=440418974213449&id=1508865.1&_afrWindowMode=0&_adf.ctrl-stat ...
 - [置顶] C++学习书单
			
关于C++的书太多了,很容易让人没有头绪.一直想整理下,把这些书列个书单出来,直到今天才动手.希望我的经验能给后来的初学者一点帮助. 1.<C++程序设计教程> 钱能 很多学校把这本书选做 ...
 - 《深入理解OSGi:Equinox原理、应用与最佳实践》笔记_2_建立开发环境
			
本文对应书本5.1.3的内容 书本中通过CVS下载的源码 但是笔者实践的时候发现无法下载...地址已经失效了(也许是笔者的失误输错地址所致) 可以用git下载 地址是: http://git.ecli ...
 - Android开展:ADT+Eclipse使用错误:Text editor does not have a document provider
			
Eclipse参加Android sdk源代码 正在使用Eclipse进行Android开发时间,我们经常需要导入sdk源代码来Eclipse中,方便api阅读和查询,详细操作为:ctrl+鼠标左键. ...
 - jstack(查看线程)、jmap(查看内存)和jstat(性能分析)命令
			
jstack(查看线程).jmap(查看内存)和jstat(性能分析)命令 公司内部同事分享的一篇文章 周末看到一个用jstack查看死锁的例子.昨天晚上总结了一下jstack(查看线程).jma ...
 - Windows Phone开发(47):轻松调用Web Service
			
原文:Windows Phone开发(47):轻松调用Web Service 众所周知(除了没用过VS的),在VS里面调用Web Service是一件很愉快的事情,不解释,相信很多朋友在以前的项目中肯 ...