操作系统环境
root@wuyang-virtual-machine:/opt/n9e# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
安装数据库和redis
#更新软件
apt-get update
apt update
#安装madiadb
apt install -y mariadb-server
systemctl enable mariadb
systemctl start mariadb
#修改数据库密码
mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1234');"
#安装redis
apt install -y redis
systemctl enable redis-server
systemctl restart redis
安装夜莺软件
mkdir -p /opt/n9e && cd /opt/n9e
tarball=n9e-v6.0.0-ga.3-linux-amd64.tar.gz
urlpath=https://download.flashcat.cloud/${tarball}
wget $urlpath || exit 1
tar zxvf ${tarball}
mysql -uroot -p1234 < n9e.sql
nohup ./n9e &> n9e.log &
修改夜莺软件配置文件
cd /opt/n9e
vim ./etc/config.toml
#153行 修改 URL为http://127.0.0.1:8428/api/v1/write
Url = "http://127.0.0.1:8428/api/v1/write"
安装部署VictoriaMetrics
mkdir /opt/victoria_metrics
cd /opt/victoria_metrics
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.90.0/victoria-metrics-linux-386-v1.90.0.tar.gz
tar -xvf victoria-metrics-linux-386-v1.90.0.tar.gz
cd /opt/victoria_metrics
nohup ./victoria-metrics-prod &> victoria-metrics-prod.log &
重新启动n9e
pkill n9e
cd /opt/n9e
nohup ./n9e &> n9e.log &
下载categraf安装包
apt-get update
apt update
apt install -y wget
mkdir /opt/categraf
cd /opt/categraf
wget https://download.flashcat.cloud/categraf-v0.2.38-linux-amd64-with-cgo-plugin.tar.gz
tar -xvf categraf-v0.2.38-linux-amd64-with-cgo-plugin.tar.gz
修改categraf配置文件
vim /opt/categraf/categraf-v0.2.38-linux-amd64/conf/config.toml
#52行 端口修改为 17000
url = “http://127.0.0.1:17000/prometheus/v1/write”
#83行 false改为true
enable = true
#87行 端口改为17000
url = “http://127.0.0.1:17000/v1/n9e/heartbeat”
启动categraf
cd /opt/categraf/categraf-v0.2.38-linux-amd64
nohup ./categraf &> categraf.log &
查看categraf是否启动成功
root@wuyang-virtual-machine:/opt/categraf/categraf-v0.2.38-linux-amd64# netstat -tnlp | grep 8428
tcp 0 0 0.0.0.0:8428 0.0.0.0:* LISTEN 155858/./victoria-m
登录web界面
安装默认端口为17000 默认账号密码为:root/root.2020
配置数据源