当前位置:网站首页>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/
边栏推荐
- What if Fiddler fails to listen to the interface
- Use of go log package log
- Google Earth Engine(GEE) 03-矢量数据类型
- Feign通过自定义注解实现路径的转义
- ICML 2022:ufrgs | optimistic linear support and subsequent features as the basis for optimal strategy transfer
- 电子科大(申恒涛团队)&京东AI(梅涛团队)提出用于视频问答的结构化双流注意网络,性能SOTA!优于基于双视频表示的方法!
- Discuz淘宝客网站模板/迪恩淘宝客购物风格商业版模板
- 抓出那些重复的基因
- N methods for obtaining effective length of genes
- MSP430F5529 单片机 读取 GY-906 红外温度传感器
猜你喜欢

Working at home is more tiring than going to work at the company?

2022年PMP项目管理考试敏捷知识点(3)

Discuz淘宝客网站模板/迪恩淘宝客购物风格商业版模板

The file or assembly 'cefsharp.core.runtime.dll' or one of its dependencies could not be loaded. Is not a valid Win32 Application. (exception from hresult:0x800700c1)

Usage of vivado vio IP

【剑指Offer】47. 礼物的最大价值

How to set the enterprise wechat group robots to send messages regularly?

ASP.NET仓库进销存ERP管理系统源码 ERP小程序源码

Zero foundation self-study SQL course | if function

C WinForm reads the resources picture
随机推荐
golang使用mongo-driver操作——查(基础)
Applet referer
【PCL自学:Segmentation4】基于Min-Cut点云分割
ClickOnce error deploying ClickOnce application - the reference in the manifest does not match the identity of the downloaded assembly
ASP.NET仓库进销存ERP管理系统源码 ERP小程序源码
【蓝桥杯集训100题】scratch数字计算 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第16题
virtualbox扩展动态磁盘大小的坑
matlab axis坐标轴相关设置详解
Can you do these five steps of single cell data cleaning?
webService
【PCL自学:PCLPlotter】PCLPlotter绘制数据分析图
seata
Feign通过自定义注解实现路径的转义
The file or assembly 'cefsharp.core.runtime.dll' or one of its dependencies could not be loaded. Is not a valid Win32 Application. (exception from hresult:0x800700c1)
clickonce 部署ClickOnce应用程序时出错-清单中的引用与下载的程序集的标识不匹配
零基础自学SQL课程 | SQL中的日期函数大全
一文剖析C语言函数
捷码赋能案例:湖南天辰产研实力迅速提升!实战玩转智慧楼宇/工地等项目
c语言字符指针、字符串初始化问题
halcon之区域:多种区域(Region)特征(6)