1. 程式人生 > >資料庫監控系統:Lepus(天兔)

資料庫監控系統:Lepus(天兔)

部署LAMP

[[email protected] ~]# tar zxvf setuptools-0.6c11.tar.gz
[[email protected] ~]# cd setuptools-0.6c11
[[email protected] setuptools-0.6c11]# python setup.py install

[[email protected] ~]# which mysql_config 
/usr/local/mysql/bin/mysql_config

[
[email protected]
 ~]# tar zxvf MySQL-python-1.2.3.tar.gz [[email protected] ~]# cd MySQL-python-1.2.3 [[email protected] MySQL-python-1.2.3]# vi site.cfg #mysql_config = /usr/local/bin/mysql_config mysql_config = /usr/local/mysql/bin/mysql_config [
[email protected]
 MySQL-python-1.2.3]# python setup.py build  [[email protected] MySQL-python-1.2.3]# python setup.py install [[email protected] ~]# cd lepus/python [[email protected] python]# python test_driver_mysql.py  MySQL python drivier is ok! [
[email protected]
 ~]# mysql -u root -pabcd.1234 mysql> create database lepus default character set utf8; mysql> grant select,insert,update,delete,create on lepus.* to 'lepus'@'localhost' identified by 'lepus'; mysql> flush privileges; mysql> use lepus mysql> source /root/lepus/sql/lepus_table.sql mysql> source /root/lepus/sql/lepus_data.sql [[email protected] ~]# cd lepus/python [[email protected] python]# chmod +x install.sh [[email protected] python]# ./install.sh [note] lepus will be install on basedir: /usr/local/lepus [note] /usr/local/lepus directory does not exist,will be created. [note] /usr/local/lepus directory created success. [note] wait copy files....... [note] change script permission. [note] create links. [note] install complete. [[email protected] ~]# cd /usr/local/lepus [[email protected] lepus]# vim etc/config.ini ###監控機MySQL資料庫連線地址### [monitor_server] host="localhost" port=3306 user="lepus" passwd="lepus" dbname="lepus" [[email protected] ~]# cd lepus [[email protected] lepus]# cp -rf php/* /usr/local/apache/htdocs [[email protected] ~]# cd /usr/local/apache/htdocs/application/config $db['default']['hostname'] = 'localhost'; $db['default']['port']     = '3306'; $db['default']['username'] = 'lepus'; $db['default']['password'] = 'lepus'; $db['default']['database'] = 'lepus'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; [[email protected] ~]# cd /usr/local/lepus [[email protected] lepus]# lepus start [[email protected] lepus]# lepus status lepus server is running...