XAMPP的一键部署LAMP环境省心省力, lepus官网手册也建议采用XAMPP的方式安装,lepus也是在XAMPP上进行研发的
注意xampp会把apache,mysql,php都安装,所以要在干净的环境中进行安装,以免安装两个mysql,两个mysql也是可以的,这里是干净的环境。
整体环境:
192.168.0.5 监控机
192.168.0.6 主 被监控机
192.168.0.9 从 被监控机
安装XAMPP
Xampp下载地址:https://www.apachefriends.org/download.html
注意你的版本号,高版本的XAMPP中可能不是Mysql而是MariaDB
[root@localhost src]# ls debug kernels xampp-linux-x64-1.8.3-5-installer.run [root@localhost src]# chmod +x xampp-linux-x64-1.8.3-5-installer.run [root@localhost src]# ./xampp-linux-x64-1.8.3-5-installer.run [root@localhost src]# /opt/lampp/lampp start
[root@localhost src]# vim /etc/profile 追加变量
export PATH=$PATH:/opt/lampp/bin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib
[root@localhost src]# source /etc/profile
下载MySQLdb-python.zip是lepus安装后监控mysql所必需的
http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip
[root@localhost src]# unzip MySQLdb-python.zip.zip [root@localhost MySQLdb1-master]# which mysql_config /opt/lampp/bin/mysql_config [root@localhost MySQLdb1-master]# yum install gcc libffi-devel python-devel openssl-devel [root@localhost MySQLdb1-master]# yum install urpmi xterm [root@localhost MySQLdb1-master]# python setup.py build [root@localhost MySQLdb1-master]# python setup.py install
lepus安装采集器(lepus官网下载)
[root@localhost src]# unzip lepus3.7.zip 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; [root@localhost lepus_v3.7]# mysql -uroot -p lepus < sql/lepus_table.sql [root@localhost lepus_v3.7]# mysql -uroot -p lepus < sql/lepus_data.sql 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);
被监控库HE1,HE2只需创建lepus_monitor账号即可
mysql> grant select,super,process,reload,show databases,replication client on *.* to'lepus_monitor'@'%' identified by 'MANAGER'; mysql> flush privileges;
Lepus配置
[root@localhost lepus_v3.7]# cd python/ [root@localhost python]# chmod +x install.sh [root@localhost python]# ./install.sh [root@localhost python]# vim /usr/local/lepus/etc/config.ini [monitor_server] host="192.168.0.5" port=3306 user="lepus_user" passwd="MANAGER" dbname="lepus"
[root@localhost lepus_v3.7]# cp -r php/* /opt/lampp/htdocs/ [root@localhostlepus_v3.7]#vim/opt/lampp/htdocs/application/config/database.php $db['default']['hostname'] = '192.168.0.5'; $db['default']['port'] = '3306'; $db['default']['username'] = 'lepus_user'; $db['default']['password'] = 'MANAGER'; $db['default']['database'] = 'lepus'; $db['default']['dbdriver'] = 'mysql';
[root@localhost lepus]# Lepus start
有问题看日志
[root@localhost lepus]# tail -f /usr/local/lepus/nohup.out [root@localhost lepus]# tail -f /usr/local/lepus/logs/lepus.log [root@localhost lepus]# vim /opt/lampp/etc/extra/httpd-vhosts.conf
删除原有 修改
AddDefaultCharset UTF-8
DocumentRoot "/opt/lampp/htdocs" ServerName mysqlmtop1.ikongjian.com
Options FollowSymLinks
AllowOverride All Order allow,deny
Allow from All
ErrorLog"|/usr/local/apache/bin/rotatelogs /home/logs/apache/php_%Y%m%d_error.log86400 480"
CustomLog"|/usr/local/apache/bin/rotatelogs /home/logs/apache/php_%Y%m%d_access.log86400 480" common
然后就可以直接在浏览器输入IP地址就会出现天兔登陆界面
默认管理员账号密码admin/Lepusadmin登录后请修改管理员密码,增加普通账号。
显示有错误 不知道情况出在哪里希望有大神指点指出
报错 没找到原因 检测不到客户端 待处理阶段
支持原版 https://blog.51cto.com/suifu/1770493
我是按照步骤做最终结果不是很理想 那位大神有解决办法 及时和我联系!