当前位置:网站首页>Build an open source and beautiful database monitoring system -lepus
Build an open source and beautiful database monitoring system -lepus
2022-06-27 23:45:00 【Brother Xing plays with the clouds】
Build an open-source and beautiful database monitoring system -Lepus
Tiantu database monitoring system -Lepus
Welcome to Tiantu database monitoring system ( Hereinafter referred to as Lepus).Lepus Is an open source database monitoring platform , Currently supported MySQL、Oracle、PostgresQL、GreatSQL、MongoDB、Redis Basic monitoring and alarm of database .Lepus No scripts or Agent, Only after the database creates the authorized account , Remote monitoring is available , Suitable for companies with more monitoring database servers and databases in the monitoring cloud , This will greatly reduce the monitoring deployment process for the enterprise , meanwhile Lepus Rich performance monitoring indicators are built in the system , Enable enterprises to identify potential performance problems and deal with them before the database goes down , Reduce direct losses caused by database problems .
Open source address : https://gitee.com/lepus-group/lepus
Official website : https://www.lepus.cc/
Lepus Yes v3 Version and v5 edition
Docker install v3 edition
https://hub.docker.com/r/georce/lepus
docker run -itd --name lepus \
--restart always \
-p 83:80 \
-p 50920:3306 \
docker.io/georce/lepus
http://IP:83
USERNAME: admin
PASSWORD: Lepusadmin
V3 Version of the control panel
This tutorial focuses on centos7 Lower installation v5 edition , And use monitoring MySQL.
system description
System : centos7
IP: 192.168.1.3
database :
192.168.1.6:3306
user name :root
password :123456Software requirements
Lepus-V5 The following software is required for deployment :
Software name | Recommended version | must | remarks |
|---|---|---|---|
Golang | 1.4-1.8 | no | Source code compilation and operation must be installed / There is no need to install... To use binary mode ( direct yum install golang) |
MySQL | 5.6 | yes | Used to store basic data and event data ( This installation tutorial is omitted ) |
InfluxDB | 1.x | no | Event data is stored by default MySQL, Support storage to InfluxDB, If used InfluxDB Requirements must be deployed ( Author not installed ) |
Redis | 5.x | yes | Used for current limiting of alarm system ( This installation tutorial is omitted ) |
NSQ | 1.2.x | yes | be based on gaolang High performance message queuing , Used for event message transmission ( Refer to the following ) |
centos7 install NSQ
NSQ It is a real-time distributed message processing platform , It is designed to process billions of levels of messages every day on a large scale .
Reference documents :https://nsq.io/overview/quick_start.html
1. Download a software
Binary download path :https://github.com/nsqio/nsq/releases
edition :nsq-1.2.1.linux-amd64.go1.16.6.tar.gz
Upload to CentOS The server , Decompression can be .
start-up Enter the... Of the decompression path /bin Catalog
2. install NSQ
Enter the... Of the decompression path /data/NSQ Catalog
# mkdir /data/NSQ
# wget http://js.funet8.com/centos_software/nsq-1.2.1.linux-amd64.go1.16.6.tar.gz # Alternate download address
# tar -zxvf nsq-1.2.1.linux-amd64.go1.16.6.tar.gz
# cd nsq-1.2.1.linux-amd64.go1.16.6/bin
1. start-up nsqlookupd(nohup Background start ):
# nohup ./nsqlookupd &
2. start-up nsqd(nohup Background start )
# nohup ./nsqd --lookupd-tcp-address=192.168.1.3:4160 &
3. start-up nsqadmin(nohup Background start )
# nohup ./nsqadmin --lookupd-http-address=192.168.1.3:4161 &
4. Start log view :bin The directory will automatically generate nohup journal , The view command is as follows :
# tail -f nohup.out3.NSQ Message test
start-up nsq_to_file, Write messages to /tmp Log file of file , By default, the file name is determined by the theme topic+ host + The date timestamp consists of
# nohup ./nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=192.168.1.3:4161 &Use curl command , Post a message , return OK
# curl -d 'hello world' 'http://192.168.1.3:4151/pub?topic=test'
OKThe browser side asks web Interface :http://192.168.1.3:4171/, The interface is as follows :
install Lepus
Linux The environment uses binary installation Lepus
1. Download the binary version Lepus
Go to the download page of the official website , Choose... Based on the operating system Linux perhaps Windows Corresponding binary package , download lepus Binary package , Download address : https://www.lepus.cc/downloads/ .
Linux The environment binary package file name is :lepus.5.x.linux-amd64.tar.gz,Windows The environment binary package file name is :lepus.5.x.windows-amd64.zip
Download this article :lepus.5.1.linux-amd64.tar.gz
2. Download and modify the file
cd /data/
wget http://js.funet8.com/centos_software/lepus.5.1.linux-amd64.tar.gz # Alternate download address
tar -zxvf lepus.5.1.linux-amd64.tar.gz
mv lepus.5.1.linux-amd64 lepus.5.13. Import initialization database
Get into lepus Binary Directory , And import the database initialization table structure and data
stay 192.168.1.6 Database on the database 'lepus_db'
cd lepus.5.1/sql
mysql -uroot -h192.168.1.6 -P'3306' -p'123456' lepus_db < init_table.sql
mysql -uroot -h192.168.1.6 -P'3306' -p'123456' lepus_db < init_data.sql4. Generate configuration files
from example Copy configuration file in , And set up , The settings include connections MySQL、Redis、NSQ、 Alarm mail gateway , (MySQL、Redis、NSQ In order to have to install ,InfluxDB Optional , Please install and deploy the open source components by yourself ).
cp etc/proxy.example.ini etc/proxy.ini
cp etc/alarm.example.ini etc/alarm.ini
cp etc/config.example.ini etc/config.iniBecause the database is not native , So you need to change the configuration
# vim etc/proxy.ini
Revised as follows [main]
port = 8800 log = /tmp/lepus_proxy.log debug=1 enable_influxdb=0
[nsq]
nsq_server = 127.0.0.1:4150
[mysql]
mysql_host = 192.168.1.6 mysql_port = 3306 mysql_user = root mysql_password = 123456 mysql_database = lepus_db
[influxdb]
influx_host = 192.168.1.6 influx_port = 8086 influx_user = root influx_password = 123456 influx_database = lepus_db # vim etc/alarm.ini Revised as follows
[main]
debug=1 log = /tmp/lepus_alarm.log
[nsq]
nsq_server = 127.0.0.1:4150
[mysql]
mysql_host = 192.168.1.6 mysql_port = 3306 mysql_user = root mysql_password = 123456 mysql_database = lepus_db
[redis]
redis_host = 127.0.0.1 redis_port = 6379 redis_pass = password
[mail]
mail_host = smtp.163.com mail_port = 465 mail_user = [email protected] mail_pass = password mail_from = [email protected] # vim etc/config.ini Modify the configuration
[main]
log_dir = /tmp/ debug = 1 interval = 10 proxy = http://127.0.0.1:8800 db_pass_key = L1e2p3u4s5Abc321
[mysql]
mysql_host = 192.168.1.6 mysql_port = 3306 mysql_user = root mysql_password = 123456 mysql_database = lepus_db
5. Start the service component
Please start the components in the following order , Error occurs during startup. Please check the configuration file , If no error is reported, you need to put the task in the background to run .
start-up Proxy modular
# cd /data/lepus.5.1/bin/
# ./lepus_proxy --config=../etc/proxy.inistart-up Task modular
# ./lepus_task --config=../etc/config.inistart-up Alarm modular
./lepus_alarm --config=../etc/alarm.iniAfter starting, you can view the process
# ps -ef|grep lepus
root 3810 3135 0 Jun16 pts/0 00:00:00 ./lepus_proxy --config=../etc/proxy.ini
root 3816 3135 0 Jun16 pts/0 00:00:00 ./lepus_task --config=../etc/config.ini
root 5329 5000 0 09:55 pts/1 00:00:00 ./lepus_alarm --config=../etc/alarm.iniView the run log , No, Error It works normally , If there are too many logs, you can change the configuration file debug Set to 0, Will not output debug journal .
tail -f /tmp/lepus_proxy.log
tail -f /tmp/lepus_task.log
tail -f /tmp/lepus_alarm.logTips :Lepus After installation, you need to install and run Lepus Console Console .
install Lepus-console
Lepus Console The console is used for configuration and management Lepus Of WEB Management interface , No console ,Lepus It can also operate normally , You can also monitor and alarm by operating database data , But use Lepus Console Will make it easier to use , And query monitoring event data and performance charts at any time .
download Lepus Console Installation package
1. Go to the download page of the official website , Choose... Based on the operating system Linux perhaps Windows Corresponding Lepus Console Binary package , download lepus Binary package , Download address : https://www.lepus.cc/downloads/ .
I download lepus-console.5.1.linux-amd64.tar.gz
mkdir /data/lepus-console
cd /data/lepus-console
wget http://js.funet8.com/centos_software/lepus-console.5.1.linux-amd64.tar.gz # Alternate download address
tar -zxvf lepus-console.5.1.linux-amd64.tar.gz
mv lepus-console.5.1.linux-amd64 lepus-console.5.12. Get into lepus-console-linux-amd64 Catalog
cd lepus-console.5.13. Copy and modify configuration files
# cp setting.example.yml setting.yml
Modify the configuration file
# vim setting.yml
Fill in the following , Modify only mysql Configuration of :
log:
path: "/tmp/lepus_api.log"
level: "debug"
debug: true
dataSource:
eventStorageEngine: mysql
host: 192.168.1.6
port: 3306
user: root
password: 123456
database: lepus_db
influxHost: 127.0.0.1
influxPort: 8086
influxUser: admin
influxPassword:
influxDatabase: lepus_db
token:
storage: "mysql"
key: "S9p2+dsfM1CzLF=="
name: "lepus-pro"
expired: "3d"
decrypt:
signKey: "1234567890abcdef"
dbPassKey: "L1e2p3u4s5Abc321"4. Run console
# ./lepus_console
...
[GIN-debug] Listening and serving HTTP on :80805. Access the console
visit IP:8080 You can log in through the login interface , The default management password is :admin/lepusadmin
Access control
thus ,lepus stay centos7 The installation is completed under the system , Then add mysql Configuration of monitoring node and exception notification alarm .
Reference resources :https://www.lepus.cc/docs/lepus-v5/
边栏推荐
- seata
- Technical implementation process of easycvr platform routing log function [code attached]
- clickonce 部署ClickOnce应用程序时出错-清单中的引用与下载的程序集的标识不匹配
- c语言之字符串数组
- mysql读写分离配置
- 解决新版chrome跨域问题:cookie丢失以及samesite属性问题「建议收藏」
- Google Earth engine (GEE) 03 vector data type
- Const keyword and its function (usage), detailed explanation of C language const
- 系统学习+主动探索,是最舒适的入门学习方式!
- Classification of cifar-10 dataset with pytorch
猜你喜欢
随机推荐
golang - new和make的区别
沉寂了一段时间 ,我又出来啦~
Structure de stockage des graphiques
c语言字符指针、字符串初始化问题
Detailed explanation of MATLAB axis coordinate axis related settings
零基础自学SQL课程 | CASE函数
C language - date formatting [easy to understand]
The National University of Singapore 𞓜 uses model free reinforcement learning to evaluate the energy efficiency of the energy efficiency data center
UESTC (shenhengtao team) & JD AI (Mei Tao team) proposed a structured dual stream attention network for video Q & A, with performance SOTA! Better than the method based on dual video representation!
Working at home is more tiring than going to work at the company?
单细胞数据清洗的这5个步骤你会做吗?
Discuz taobaoke website template / Dean taobaoke shopping style commercial version template
Usage of vivado vio IP
通过中金证券经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
树莓派(以及各种派)使用指南
【AI应用】NVIDIA Tesla V100-PCIE-32GB的详情参数
const关键字及其作用(用法),C语言const详解
【蓝桥杯集训100题】scratch数字计算 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第16题
Stream + Nacos
使用cef3开发的浏览器不支持flash问题的解决









