centos 7.9+mysql 5.7+nightingale v6.0+redis安装

前言

官方地址:https://github.com/ccfos/nightingale。
中国地址:https://flashcat.cloud/docs/。
在这里插入图片描述

nightingale的架构

当监控端与被监控端网络状况良好时,使用中心汇聚式部署方案。在这里插入图片描述
当监控端与被监控端网络状况较差时,使用边缘下沉式混杂部署方案。
在这里插入图片描述

  • mysql:存放全部配置类信息(告警规则、屏蔽规则、订阅规则、监控大盘、人员信息、权限信息)和告警事件。
  • redis:存放验证信息(jwt的token、机器的元信息、心跳信息)。
  • TSDB:存放由插件采集而来的时序数据。

nightingale v6.0安装

# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

systemctl stop firewalld && systemctl disable firewalld
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && getenforce
yum update
yum install epel-release wget ntp ntpdate -y
ntpdate cn.pool.ntp.org
crontab -e
* */1 * * * /usr/sbin/ntpdate cn.pool.ntp.org

rpm -qa | grep -i mariadb
mariadb-libs-5.5.68-1.el7.x86_64
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
# 编辑软件源
vim /etc/yum.repos.d/mysql-community.repo
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

sudo yum install mysql-community-server -y
systemctl start mysqld.service
# 查看mysql初始密码
cat /var/log/mysqld.log | grep password
netstat -lntp | grep 3306
mysql -uroot -p
mysql> set password for root@localhost = password('Cfxy!1234');

yum install -y redis
systemctl enable redis && systemctl restart redis
netstat -lntp | grep 6379

mkdir -p /opt/n9e && cd /opt/n9e
wget https://download.flashcat.cloud/n9e-v6.0.0-ga.6-linux-amd64.tar.gz
tar zxvf n9e-v6.0.0-ga.6-linux-amd64.tar.gz


mysql -uroot -p < n9e.sql
vi etc/config.toml
DSN="root:Cfxy!1234@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"

nohup ./n9e &> n9e.log &
netstat -lntp | grep 17000
# 打开浏览器访问地址:http://192.168.40.101:17000/login。用户名:root,密码:root.2020

cd /opt
wget https://download.flashcat.cloud/categraf-v0.3.1-linux-amd64.tar.gz
tar zxvf categraf-v0.3.1-linux-amd64.tar.gz
mv categraf-v0.3.1-linux-amd64 categraf && cd categraf
vi conf/config.toml
hostname = "n9e_local"
url = "http://127.0.0.1:17000/prometheus/v1/write"
[heartbeat]
enable = true

# report os version cpu.util mem.util metadata
url = "http://127.0.0.1:17000/v1/n9e/heartbeat"


sudo cp conf/categraf.service /etc/systemd/system/ && sudo systemctl daemon-reload && systemctl enable categraf && systemctl start categraf
ps -aux | grep categraf

cp conf/categraf.service ./n9e.service
vi n9e.service
[Unit]
Description="nightingale"
After=network.target

[Service]
Type=simple

ExecStart=/opt/monitor/n9e/n9e
WorkingDirectory=/opt/monitor/n9e

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


[Install]
WantedBy=multi-user.target

cp n9e.service /etc/systemd/system/ && sudo systemctl daemon-reload && systemctl enable n9e &&systemctl start n9e
# 打开浏览器访问地址:http://192.168.40.101:17000/login
# ./categraf --test --debug

在这里插入图片描述

安装victoriametrics作为数据源

官方地址:https://victoriametrics.com/
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

cd /opt/
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.90.0/victoria-metrics-linux-amd64-v1.90.0.tar.gz
tar zxvf victoria-metrics-linux-amd64-v1.90.0.tar.gz
nohup ./victoria-metrics-prod &> stdout.log &
ss -lntp | grep 8428
cd /opt/n9e/
vi etc/config.toml
[[Pushgw.Writers]]
# Url = "http://127.0.0.1:8480/insert/0/prometheus/api/v1/write"
# Url = "http://127.0.0.1:9090/api/v1/write"
Url = "http://127.0.0.1:8428/api/v1/write"

pkill n9e
nohup ./n9e &> n9e.log &

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

安装prometheus作为数据源

GitHub网址:https://github.com/prometheus/prometheus
在这里插入图片描述
在这里插入图片描述

cd /opt
wget https://github.com/prometheus/prometheus/releases/download/v2.43.1/prometheus-2.43.1.linux-amd64.tar.gz
tar zxvf prometheus-2.43.1.linux-amd64.tar.gz
cd prometheus-2.43.1.linux-amd64
nohup ./prometheus --config.file=prometheus.yml &> stdout.log &
ss -lntp | grep prometheus
# 配置n9e
vim /opt/n9e/etc/config.toml
[[Pushgw.Writers]]
# Url = "http://127.0.0.1:8480/insert/0/prometheus/api/v1/write"
Url = "http://127.0.0.1:9090/api/v1/write"

cd /opt/n9e/
pkill n9e
nohup ./n9e &> n9e.log &

在这里插入图片描述在这里插入图片描述
最后点击保存并测试。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值