夜莺nightingale的安装与启动

一 server安装

使用二进制安装
https://flashcat.cloud/docs/content/flashcat-monitor/nightingale-v7/install/binary/

下载地址https://flashcat.cloud/download/nightingale/

需要提前安装mysql 与redis
解压tar包,在etc/config.toml 中修改mysql和redis的链接配置信息
也可以配置日志信息

[Log]
Dir= "logs"
Level= "INFO"
Output= "file"
RotateNum= 3
RotateSize= 256

在mysql中导入夜莺的sql

mysql -uroot -pxxxx < n9e.sql

给二进制文件做软连接

ln -s /data/project/nightingale/n9e /usr/local/bin/n9e

启动二进制文件

nohup n9e &> n9e.log &

 使用systemctl启动,编写配置文件,注意需要配置WorkingDirectory或者使用--configs指定配置文件(ExecStart=/usr/local/bin/n9e  --configs /data/project/nightingale/etc),因为默认在启动的当前环境,如果不指定会报错failed to initialize: dialector() not supported

[Unit]
Description=n9e Service

[Service]
WorkingDirectory=/data/project/nightingale/
Type=simple
ExecStart=/usr/local/bin/n9e
Restart=on-failure

[Install]
WantedBy=multi-user.target

此时,可以使用systemctl进行管理

systemctl start n9e

二.agent安装

夜莺自身的agent为categraf

1. 下载并解压的安装包

wget https://download.flashcat.cloud/categraf_ent-v0.3.94-linux-amd64.tar.gz tar zxvf categraf_ent-v0.3.94-linux-amd64.tar.gz

2. 修改 conf/config.toml , 将 providers 改为 [“local”,“http”] ,修改 [http_provider], 配置参考如下

providers = ["local","http"] [http_provider] # 将 ${n9e_ip} 替换为 n9e 的实际地址 remote_url = "http://${n9e_ip}:17000/v1/n9e-plus/collects"

3. 启动 categraf 采集器

# 以service方式安装, 相当于添加service文件+systemctl daemon-reload
sudo ./categraf --install
# 以service方式查看categraf,相当于systemctl status categraf
sudo ./categraf --status

 

posted @ 2024-05-22 08:51  潇潇暮鱼鱼  阅读(26)  评论(0编辑  收藏  举报