安装Nightingale-夜莺记录

本次记录使用Centos7.x最小安装版操作
夜莺官网:http://n9e.flashcat.cloud/

服务端组件部署

夜莺组件结构
由此可见,我们需要安装MySQL、Redis、Prometheus。
MySQL安装:https://blog.csdn.net/li1244453393/article/details/128657284
Redis安装:https://blog.csdn.net/li1244453393/article/details/128672727

安装Prometheus

prometheus的github:https://github.com/prometheus/prometheus
我们可以下载一个适合自己系统的发布版
这里我使用 prometheus-2.37.4.linux-amd64.tar.gz
上传到服务器上并解压,这里我解压到 /home/prometheus-2.37.4.linux-amd64 后续操作都将使用这个目录
将该目录拷贝到/opt目录下并命名为prometheus

cp -far /home/prometheus-2.37.4.linux-amd64/* /opt/prometheus

在/etc/systemd/system目录下新建文件 prometheus.service ,文件内容如下

[Unit]
Description="prometheus"
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple

ExecStart=/opt/prometheus/prometheus  --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m 

Restart=on-failure
SuccessExitStatus=0
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=prometheus

[Install]
WantedBy=multi-user.target

启动Prometheus

systemctl daemon-reload
systemctl enable prometheus
systemctl restart prometheus
systemctl status prometheus

状态
prometheus状态

安装夜莺

夜莺的github:https://github.com/didi/nightingale
我们可以下载一个适合自己系统的发布版
这里我使用 n9e-v5.14.5-linux-amd64.tar.gz
上传到服务器上并解压,这里我解压到 /home/n9e 后续操作都将使用这个目录

导入夜莺的MySQL

使用mysql命令导入

./mysql -uroot -proot < /home/n9e/docker/initsql/a-n9e.sql

注意,密码请根据自己的实际调整

修改夜莺的配置

配置文件
注意:修改时两个一同修改
服务端:/home/n9e/etc/server.conf
Web端:/home/n9e/etc/webapi.conf

夜莺使用了Prometheus的默认端口,如果需要修改Prometheus的地址和端口,编辑配置文件,搜索 [Reader] 节点,找到该节点的 Url 配置项修改。注意:该配置仅server.conf中存在。

配置MySQL:搜索 [DB] 节点,找到该节点的 DSN 配置项修改

配置Redis:搜索 [Redis] 节点

启动夜莺

进入夜莺解压目录

cd /home/n9e

启动服务端

nohup ./n9e server > server.log & clear

启动Web端

nohup ./n9e webapi > webapi.log & clear
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值