centos7安裝lepus

1.安裝lamp

wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

yum localinstall mysql80-community-release-el7-3.noarch.rpm

yum install mysql-server

systemctl start mysqld

systemctl enable mysqld

grep password /var/log/mysqld.log

mysql_secure_installation

yum install php php-mysql

systemctl start httpd

systemctl enabled httpd

2.安裝python模塊

yum install MySQL-python.x86_64 -y

3.安裝lepus

yum install git -y

cd /usr/local

git clone https://github.com/ruzuojun/lepus.git

cd lepus
chmod u+x lepus*

ln -s /usr/local/lepus/lepus /usr/local/sbin/lepus
ln -s /usr/local/lepus/lepus_monitor /usr/local/sbin/lepus_monitor

4.在監控機創建監控數據庫

cd /usr/local/lepus/sql/

mysql -u root -p

create database lepus default character set utf8;
grant select,insert,update,delete,create on lepus.* to ‘admin’@’localhost’ identified by ‘123456’;
flush privileges;

use lepus;
source lepus_table.sql; // 先導表結構
source lepus_data.sql; // 再導數據

5.修改配置文件

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

[monitor_server]

host=”127.0.0.1″
port=3306
user=”admin”
passwd=”123456″
dbname=”lepus”

6.啓動Lepus
lepus start

7.安裝web管理後臺

cp -rf /usr/local/lepus/web/* /var/www/html/

vim /var/www/html/application/config/database.php

$db[‘default’][‘hostname’] = ‘localhost’;
$db[‘default’][‘port’] = ‘3306’;
$db[‘default’][‘username’] = ‘admin’;
$db[‘default’][‘password’] = ‘123456’;
$db[‘default’][‘database’] = ‘lepus’;

8.重啓httpd

systemctl restart httpd

9.訪問lepus

http://192.168.10.1

admin/Lepusadmin

10.在lepus上添加mysql監控實例

首先需要在被監控端授權

grant select,process,super on . to ‘testusre’@’192.168.10.1’ identified by ‘Redhat.123’;

flush privileges;

然後在web管理頁面—“配置中心”—MySQL添加

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章