部署夜莺监控
Reverse Lv4

下载软件包

GitHub 下载软件包,点这里跳转

我这里使用v8.2.2版本,下载n9e-v8.2.2-linux-amd64.tar.gz

1
wget https://release-assets.githubusercontent.com/github-production-release-asset/xxxxxx -O n9e-v8.2.2-linux-amd64.tar.gz

解压软件包

1
tar -zxvf n9e-v8.2.2-linux-amd64.tar.gz

安装数据库和Redis

偷个懒,直接按照官网的来

1
2
3
4
5
apt update
apt -y install mariadb* redis
/etc/init.d/mariadb start # 启动mariadb
/etc/init.d/redis-server start # 启动redis
mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');" # 设置密码(强度建议高一些)

然后开始导入表结构

1
mysql -uroot -p1234 < n9e.sql

修改配置文件

./etc/config.toml文件中按需更改配置,我这里就不详细演示了,具体配置介绍看官网文档,或者 AI 一下都行

启动夜莺

command部分建议使用-configs选项指定配置文件的位置

额外注意一下,这里的-configs选项是指定配置文件的所在目录,而不是文件本身, 否则会报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash

mkdir -p /etc/supervisor.d/

cat >/etc/supervisor.d/nightingale.conf <<EOF
[program:nightingale]
directory=/apps/data/
command=/apps/data/n9e -configs /apps/data/etc/
autostart=true
autorestart=true
startsecs=5
stdout_logfile=/apps/data/logs/stdout.log
stderr_logfile=/apps/data/logs/stderr.log
user=root
EOF

# 启动服务
supervisorctl reread
supervisorctl update
supervisorctl start nightingale
supervisorctl status nightingale