@zhangyy
2021-01-12T17:53:20.000000Z
字数 3173
阅读 132
运维系列
- 一: 天兔(lepus) 监控介绍
- 二: 天兔(lepus) 安装环境配置
- 三: 天兔(lepus)部署
Lepus(天兔)数据库企业监控系统是一套由专业DBA个人(目前就职于某互联网公司),针对互联网企业开发的一款专业、强大的企业数据库监控管理系统,企业通过Lepus可以对数据库的实时健康和各种性能指标进行全方位的监控。目前已经支持MySQL、Oracle、MongoDB、Redis数据库的全面监控.
参考:官方文档
http://www.lepus.cc/manual/index/
搭建环境如下:
CentOS 7.5x64
已关闭iptables / selinux
安装天兔版本: lepus3.8Beta
主机名配置:
192.168.20.73 lepus.flyfish
1. 配置LAMP 环境 安装php httpd 服务
yum install -y php httpd
service httpd start
chkconfig httpd on
2.安装mysql-server
yum remove -y mariadb-libs
yum install -y perl-Data-Dumper
tar -xvf MySQL-5.6.43-1.el7.x86_64.rpm-bundle.tar
rpm -ivh MySQL-shared-compat-5.6.43-1.el7.x86_64.rpm
rpm -ivh MySQL-shared-5.6.43-1.el7.x86_64.rpm
rpm -ivh MySQL-devel-5.6.43-1.el7.x86_64.rpm
rpm -ivh MySQL-embedded-5.6.43-1.el7.x86_64.rpm
rpm -ivh MySQL-test-5.6.43-1.el7.x86_64.rpm
rpm -ivh MySQL-server-5.6.43-1.el7.x86_64.rpm
找到mysql的初次登录密码
cat .mysql_secret
service mysql start
chkconfig mysql on
mysql -uroot -p
set password = password ("flyfish225");
flush privileges;
3.安装lepus server需要的依赖包
yum install gcc python-devel net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml -y
4. 配置php的环境
sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g" /etc/php.ini
sed -i "s#max_execution_time = 30#max_execution_time = 300#g" /etc/php.ini
sed -i "s#post_max_size = 8M#post_max_size = 32M#g" /etc/php.ini
sed -i "s#max_input_time = 60#max_input_time = 300#g" /etc/php.ini
sed -i "s#memory_limit = 128M#memory_limit = 128M#g" /etc/php.ini
sed -i "/;mbstring.func_overload = 0/ambstring.func_overload = 2\n" /etc/php.ini
5.安装MySQLdb-python
unzip MySQL-python-1.2.5.zip
which mysql_config
cd Mysql_python-1.2.5
vim site.cfg
----
mysql_config = /usr/bin/mysql_config
----
yum install python-setuptools
python setup.py build
python setup.py install
6. 安装redis 如果不监控redis 可以不安装
wget https://pypi.python.org/packages/source/r/redis/redis-2.10.3.tar.gz
tar -zxvf redis-2.10.3.tar.gz
cd redis-2.10.3
python setup.py install
下载Lepus软件包下载地址:http://www.lepus.cc/soft/17,然后登录数据库创建lepus数据库和MySQL用户
----
unzip Lepus数据库企业监控系统3.8_Beta版本官方下载.zip
cd Lepus_v3.8_beta/
在mysql 当中 创建lepus库并授权
mysql -uroot -pflyfish225
create database lepus default character set utf8;
grant select,insert,update,delete,create on lepus.* to 'lepus'@'localhost' identified by 'lepus';
grant select,insert,update,delete,create on lepus.* to 'lepus'@'127.0.0.1' identified by 'lepus';
flush privileges;
导入lepus数据库初始化数据
cd /root/Lepus_v3.8_beta/sql
mysql -uroot -pflyfish225 lepus < lepus_table.sql
mysql -uroot -pflyfish225 lepus < lepus_data.sql
安装lepus并,运行脚本install.sh
cd /root/Lepus_v3.8_beta/python
sh install.sh
给全部脚本有执行权限,修改lepus连接数据库的配置文件
cd /usr/local/lepus/
chmod +x *.py
chmod +x *.sh
cd /usr/local/lepus/etc/
vim config.ini
---
###监控机MySQL数据库连接地址###
[monitor_server]
host="127.0.0.1"
port=3306
user="lepus"
passwd="lepus"
dbname="lepus"
---
启动:lepus
lepus --help
lepus start
cd /root/Lepus_v3.8_beta/php
cp -ap * /var/www/html/
cd /var/www/html/application/config
vim database.php
----
$db['default']['hostname'] = '127.0.0.1';
$db['default']['port'] = '3306';
$db['default']['username'] = 'lepus';
$db['default']['password'] = 'lepus';
$db['default']['database'] = 'lepus';
$db['default']['dbdriver'] = 'mysql';
----
重新启动httpd 服务
service httpd restart
使用web访问:
http://192.168.20.73
默认用户名: admin 密码: Lepusadmin