配置 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
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.