配置 Cacti 監控 MySQL 資料庫狀態

來源:互聯網
上載者:User

配置 Cacti 監控 MySQL 資料庫狀態

MySQL 自身在效能監測方面很不給力、這是令許多 MySQL DBA 夜夜輾轉難眠、幸運的是、通過 Cacti 監測(注意是監測而非監控)MySQL 資料庫狀態。

藉助 cacti+rrdtool 強大的繪圖功能、加上專用的 mysql 模板、能夠靈活快速的建立對多個 MySQL 執行個體的監測

㈠ 如果是RPM方式安裝,需要下列RPM包:

httpd

php

php-mysql

php-snmp

mysql

mysql-server

net-snmp*

㈡ 安裝 RRDTool

# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.14.tar.gz

# tar -zxv -f rrdtool-1.4.4.tar.gz

# ./configure --prefix=/usr/local/rrdtool  --disable-python  --disable-tcl

# make

# make install

可能遇到的故障:

configure: error: Please fix the library issues listed above and try again

請查閱→→troubleshoting 

㈢ 安裝 CACTI

# wget http://www.cacti.net/downloads/

# useradd cacti

# tar -zxv -f cacti-0.8.7i.tar.gz

# mv cacti-0.8.7i /var/www/cacti

# chown -R cacti:cacti /var/www/cacti

㈣ 配置 apache 模組

編輯 apache 設定檔:vim httpd.conf

① 修改服務名稱:

ServerAdmin 192.168.1.113:80

② 修改網站起始目錄:

DocumentRoot "/var/www"

③ 修改目錄:

<Directory "/var/www">

④ 增加預設做為首頁的檔案名稱:

DirectoryIndex index.html index.php

⑤ 增加對php類型的支援:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

然後:wq儲存退出!

執行 apachectl -t 檢查設定檔文法,正常情況下應返回Syntax OK:

啟動snmp服務:service snmpd start

啟動apache服務:apachectl start

  • 1
  • 2
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.