一、下载源码x86
夜莺源码:
https://github.com/ccfos/nightingale/releases/download/v7.3.1/n9e-v7.3.1-linux-amd64.tar.gz
参考文档:
使用二进制方式部署夜莺 - 快猫星云使用二进制方式部署夜莺 - 快猫星云
Nightingale 夜莺监控系统 - 部署篇(1)_夜莺监控软件-优快云博客
二、准备环境
1、主机
OS | Version | Comment |
---|---|---|
CentOs Linux | 7.9/2009 |
2、服务
Server | Version | Comment |
---|---|---|
n9e | v7.3.1 | 夜莺服务端(数据展示) |
mysql | v5.7.44 | DB存储 |
redis | v3.2.12 | DB缓存 |
prometheus | v2.37.6 | TSDB时序数据库 |
三、架构图
prometheus作为数据源,只使用夜莺的报警管理功能,夜莺也可以接受数据并存放到时序数据库。
四、开始部署
#解压
mkdir /opt/n9e -p
tar xf n9e-v7.3.1-linux-amd64.tar.gz -C /opt/n9e/
#导入数据库表结构和创建用户
mysql -uroot -p < n9e.sql
mysql -uroot -p
>create user 'n9e'@'localhost' identified by 'password';
>grant all privileges on n9e_v6.* to 'n9e'@'localhost';
>flush privileges;
>\q
#配置
cd /opt/n9e
cp etc/config.toml{,.bck} && vim etc/config.toml
redis配置文件在 /etc/redis.conf
#二进制运行或者加入systemd托管
nohup ./n9e &> n9e.log &
#加入systemd管理
cat <<EOF >/etc/systemd/system/n9e.server
[Unit]
Description="n9e.service"
After=network.target
[Service]
Type=simple
ExecStart=/opt/n9e/n9e
WorkingDirectory=/opt/n9e
Restart=on-failure
SuccessExitStatus=0
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=n9e.service
[Install]
WantedBy=multi-user.target
EOF
#启动服务并查看端口是否被监听
systemctl enable --now n9e.service
ss -ntpl|grep 17000
前端页面:默认用户root,密码root.2020
五、添加数据源
集成中心添加数据源选择Prometheus
导入内置仪表盘