CentOS搭建lepus3.8監控MySQL

來源:互聯網
上載者:User

標籤:centos搭建lepus3.8監控mysql

CentOS搭建lepus3.8監控MySQL


yum -y install gcc libffi-devel python-devel openssl-devel mysql-devel zlib-devel


監控端安裝資料庫連接Python的驅動包

1).安裝 MySQLdb for python (如果需要監控MySQL則必須安裝)

MySQLdb為Python串連和操作MySQL的類庫,如果準備使用lepus系統監控MySQL資料庫,那麼該模組必須安裝。

[[email protected] ~]# wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip 

[[email protected] ~]# unzip MySQLdb-python.zip 

[[email protected] ~]# cd MySQLdb1-master/ 

[[email protected] ~]# which mysql_config 

/usr/local/mysql/bin/mysql_config

 

[[email protected] ~]# vim site.cfg 修改如下: 

mysql_config = /usr/local/mysql/bin/mysql_config

 

[[email protected] ~]# python setup.py build 

[[email protected] ~]# python setup.py install



下載lepus3.8 官方地址

http://www.lepus.cc/soft/18


[[email protected] ~]# unzip lepus3.8.zip

[[email protected] ~]# cd Lepus_v3.8_beta


在監控機建立監控資料庫,並授權。

監控庫

[[email protected] ~]# mysql -uroot -p"[email protected]"

mysql> create database lepus default character set utf8;

mysql> grant select,insert,update,delete,create on lepus.* to ‘lepus_user‘@‘%‘ identified by‘MANAGER‘;

mysql> flush privileges;

[[email protected]_v3.8_beta]# mysql -uroot -p lepus < sql/lepus_table.sql

[[email protected]_v3.8_beta]# mysql -uroot -p lepus < sql/lepus_data.sql

 

 ##### set names utf8; ######

 

mysql> use lepus

mysql> alter table mysql_status modify column max_connect_errors bigint(18);

mysql> alter table mysql_status_history modify column max_connect_errors bigint(18);

被監控庫

mysql> grant select,super,process,reload,show databases,replication client on *.* to‘lepus_monitor‘@‘localhost‘ identified by ‘MANAGER‘;

mysql> flush privileges;

 

安裝Lpeus程式

進入到Lepus軟體包的python檔案夾

# cd python/

授予install.sh可執行許可權

# chmod +x install.sh

 

執行安裝

# ./install.sh

 

修改設定檔

進入到安裝目錄,預設為/usr/local/lepus

[[email protected]~]# vi /usr/local/lepus/etc/config.ini

###監控機MySQL資料庫連接地址###

[monitor_server]

host="192.168.1.250"

port=4008

user="lepus_user"

passwd="MANAGER"

dbname="lepus"

 

 

 

重啟lepus進程

ln -s /usr/local/lepus/lepus /etc/init.d/


service lepus stop

service lepus start

 

[[email protected]]# tail -f logs/lepus.log


安裝WEB管理台

進入到你的lepus軟體目錄

[[email protected] ~]# cd Lepus_v3.8_beta/

[[email protected]_v3.8_beta]# cp -r php /home/www

 

 

[[email protected] ~]# vim /home/www/php/application/config/database.php

$db[‘default‘][‘hostname‘] = ‘192.168.1.250‘;

$db[‘default‘][‘port‘]     = ‘4008‘;

$db[‘default‘][‘username‘] = ‘lepus_user‘;

$db[‘default‘][‘password‘] = ‘MANAGER‘;

$db[‘default‘][‘database‘] = ‘lepus‘;

$db[‘default‘][‘dbdriver‘] = ‘mysql‘;

 

登入進行添加主機和監控

通過瀏覽器開啟監控介面,即可登入系統。.預設管理員帳號密碼admin/Lepusadmin登入後請修改管理員密碼,增加普通帳號。



-----

2017/04/24 16:50:32 [error] 17648#0: *100 open() 

"/var/www/html/index.php/login" failed (20: Not a directory),

 client: 124.207.48.234, server: 221.195.1.233, request: "GET 

 /index.php/login?return_url=http://221.195.1.233:8080/index.php 

 HTTP/1.1", host: "221.195.1.233:8080"

-----報錯資訊



修改lepus登入使用者名稱和密碼

mysql> use lepus


mysql> update admin_user set password=md5("[email protected]") where user_id=1;


mysql> update admin_user set username=‘zykj_admin‘ where user_id=1;



這個是登陸mysql修改lepus的登陸賬戶和密碼


 zykj_admin  [email protected]


CentOS搭建lepus3.8監控MySQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.