nagios¼à¿ØmysqlÖ÷´Ó¸´ÖÆ
nagios¼à¿ØmysqlÖ÷´Ó¸´ÖÆ
×÷ÕߣºÌïÒÝ(sery@163.com
)
ÆðÒò£ºnagios¿ÉÄܼà¿Øµ½mysql·þÎñµÄÔËÐÐÇé¿ö£¬µ«È·²»Äܼà¿ØmysqlµÄÖ÷´Ó¸´ÖÆÊÇ·ñÕý³££ºÓÐʱºò£¬Í¬²½ÒѾֹͣ£¬µ«¹ÜÀíÈËԱȴ²»ÖªµÀ¡£
ÏÂÊÖ´¦£ºµÇ½mysql´Ó·þÎñÆ÷£¬Í¨¹ýÖ´ÐÐ mysql> show slave status\G
²é¿´ÆäÊä³ö£¬¼´¿ÉÅж¨Ö÷´Ó¸´ÖÆÊÇ·ñÕý³£¡£ÏÂÃæÊÇij¸ö´Ó·þÎñÆ÷µÄÊä³ö£º
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.93.16
Master_User: rep1
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 1752541
Relay_Log_File: hy-mysql3-relay-bin.000088
Relay_Log_Pos: 2339
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Õâ¸öÊä³ö£¬×î¹Ø¼ü´¦¾ÍÊÇ"Slave_IO_Running: Yes
“ºÍ“Slave_SQL_Running: Yes
”£¬ÕâÁ½¸öֵȫÊÇ"Yes"¾Í±íÃ÷Ö÷´Ó¸´ÖÆÕý³££¬·ñÔò¾ÍÊÇÓÐÎÊÌâ¡£
²Ù×÷²½Ö裺
1¡¢ÔÚÖ÷Êý¾Ý¿â·þÎñÆ÷Ôö¼ÓÒ»¸öÓû§£¬¸øÓè½ÏµÍµÄȨÏÞ£¬²Ù×÷Ϊ
mysql > grant Replication client on *.* to 'nagios'@'%'
identified by 'nagios';
mysql> flush privileges;
2¡¢µÇ½´Ó·þÎñÆ÷Ñé
Ïà¹ØÎĵµ£º
»·¾³ÉèÖãº
°²×°ÍêMySQLÖ®ºó£¬½«°²×°Ä¿Â¼ÖеÄincludeĿ¼ÏµÄlibmysql.libÎļþ¿½µ½VS2008°²×°Ä¿Â¼ÖеÄVC\lib\Ï£¬È»ºóÔÚ ÏîÄ¿-Ñ¡Ïî-c/c++-³£¹æ Öеĸ½¼Ó°üº¬Ä¿Â¼ÒÔ¼° Á´½ÓÆ÷-³£¹æ Öеĸ½¼Ó¿âĿ¼ÖмÓÈë“c:\MySQL\include\”£¬²¢ÇÒÔÚ Á´½ÓÆ÷-ÊäÈë Öеĸ½¼ÓÒÀÀµÏîÄÚÌí¼Ó“lib ......
//µ¼³ö
String mysql="mysqldump -uroot -proot --opt databasename > d:/test.sql";
java.lang.Runtime.getRuntime().exec("cmd /c "+mysql);
//µ¼Èë
String mysql="mysqladmin -uroot -proot create databasename";
java.lang.Runt ......
1¡¢±à¼MySQLÅäÖÃÎļþ£º
windows»·¾³ÖУº%MySQL_installdir%\my.ini¡¡//Ò»°ãÔÚMySQL°²×°Ä¿Â¼ÏÂÓÐmy.ini¼´MySQLµÄÅäÖÃÎļþ¡£
linux»·¾³ÖУº/etc/my.cnf
ÔÚ[MySQLd]ÅäÖöÎÌí¼ÓÈçÏÂÒ»ÐУº
skip-grant-tables
±£´æÍ˳ö±à¼¡£
2¡¢È»ºóÖØÆôMySQL·þÎñ
windows»·¾³ÖУº
net stop MySQL
net start MySQL
linux»·¾³ÖУº
/e ......
http://hi.baidu.com/ubuntu2me/blog/item/e1bd54de9a428f1862279828.html
¡¾IT168¼¼ÊõÎĵµ
¡¿ÈκÎÒ»ÖÖÊý¾Ý¿âÖУ¬¶¼Óи÷ÖÖ¸÷ÑùµÄÈÕÖ¾¡£MysqlÒ²²»ÀýÍ⣬ÔÚMysqlÖÐÓÐ4ÖÖ²»Í¬µÄÈÕÖ¾¡¢·Ö±ð´íÎóÈÕÖ¾¡¢¶þ½øÖÆÈÕÖ¾¡¢²éѯÈÕÖ¾ºÍÂý²éѯÈÕÖ¾¡£ÕâЩÈÕÖ¾¼Ç¼×ÅMysqlÊý¾Ý¿â²»Í¬·½ÃæµÄ×Ù¼£¡£ÏÂÎĽ«½éÉÜÕâ4ÖÖ²»Í¬µÄÈÕÖ¾×÷ÓúÍÓÃ;¡£
¡¡¡ ......