Lepus(天兔)监控MySQL部署

http://www.dbarun.com/docs/lepus/install/lnmp/

注意:xampp mysqldb-python版本太高会导致lepus白屏

apache版本最好选择2.2

环境:

192.168.139.153 master_mysql

192.168.139.154 slave_mysql

192.168.139.155 lepus

一,安装Xampp

chmod +x xampp-linux-x64-7.3.0-0-installer.run

./xampp-linux-x64-7.3.0-0-installer.run

按照需求选择完成安装

###启动lampp服务

/opt/lamp/lamp start   各项服务显示Ok

二,安装Python基础模块

unzip MySQL-python-1.2.5.zip

cd MySQL-python-1.2.5/

which mysql_config  ===>/usr/bin/mysql_config

vi site.cfg   增加如下内容:mysql_config=/usr/bin/mysql_config

yum install -y openssl-devel python-devel gcc libffi-devel xterm urpmi mysql-devel

python setup.py build

python setup.py install

三,安装lepus采集器

unzip lepus.zip

四,创建监控数据库&授权

监控数据库上创建权限

/opt/lampp/bin/mysql -u root -p  密码为空

mysql>create database lepus default character set utf8;

mysql>grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'192.168.139.%' identified by '123qweASD!';

被监控数据库创建权限:

mysql> create user 'lepus_monotor'@'192.168.139.%' identified by '123qweASD!';

mysql> grant select,super,process,reload,show databases,replication client on *.* to 'lepus_monotor'@'192.168.139.%';

mysql>flush privileges;

五,初始化数据

cd lepus/sql/

[root@bogon sql]# /opt/lampp/bin/mysql -uroot lepus < lepus_table.sql
[root@bogon sql]# /opt/lampp/bin/mysql -uroot lepus < lepus_data.sql

六,安装Lepus

cd lepus/python/

chmod +x install.sh

./install.sh

修改配置文件

vim /usr/local/lepus/etc/config.ini

###监控机MySQL数据库连接地址###
[monitor_server]
host="192.168.139.155"
port=3306
user="lepus_user"
passwd="123qweASD!"
dbname="lepus

启动lepus服务:

lepus start

七,配置Web管理平台

mkdir  /opt/lampp/htdocs/lepus

cp -rf /opt/lepus/php/* /opt/lampp/htdocs/lepus/

cd /opt/lampp/htdocs/lepus/

vim application/config/database.php

$db['default']['hostname'] = '192.168.139.155';
$db['default']['port'] = '3306';
$db['default']['username'] = 'lepus_user';
$db['default']['password'] = '123qweASD!';
$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;

重启lampp服务:

/opt/lampp/lampp restart

登陆lepus服务器监控界面

http://192.168.139.155/lepus

用户名/密码 admin/Lepusadmin

上一篇:【转】JAVA程序中Float和Double精度丢失问题


下一篇:Java中对象的三种状态