夜莺监控5.1单机部署

时人不识凌云木,直待凌云始道高。这篇文章主要讲述夜莺监控5.1单机部署相关的知识,希望能为你提供帮助。
环境版本

  • centos7
  • mysql5.7
  • redis5
  • prometheus-2.28.0
centos7 简单初始化
yum install wget lrzsz -y
systemctlstop firewalld
systemctldisable firewalld
yum install iptables-services -y##配置防火墙再启动
echo "unset MAILCHECK" > > /etc/profile
source /etc/profile
chmod +x /etc/rc.d/rc.local
echo "ulimit -SHn 102400" > > /etc/rc.local
cat > > /etc/security/limits.conf < < EOF
* soft nofile 65535
* hard nofile 65535
EOF
sed -i s#SELINUX=enforcing#SELINUX=disabled# /etc/selinux/config
setenforce 0
echo 10 > /proc/sys/vm/swappiness

安装Prometheus1.安装promethues作为存储
mkdir/data/soft -p
cd /data/soft
wget https://github.com/prometheus/prometheus/releases/download/v2.32.1/prometheus-2.32.1.linux-amd64.tar.gz
## 或者网盘下载链接: https://caiyun.139.com/m/i?185C6zFvvPfHp提取码:cJSP
tar xf prometheus-2.32.1.linux-amd64.tar.gz
mvprometheus-2.32.1.linux-amd64prometheus

2.配置Prometheus启动服务
cat > /etc/systemd/system/prometheus.service< < EOF
[Unit]
Description="prometheus"
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
ExecStart=/data/soft/prometheus/prometheus--config.file=/data/soft/prometheus/prometheus.yml --storage.tsdb.path=/data/soft/prometheus/data --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m--storage.tsdb.retention=90d
Restart=on-failure
RestartSecs=5s
SuccessExitStatus=0
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=prometheus
[Install]
WantedBy=multi-user.target
EOF
#保存历史数据,默认为15天。
#在启动脚本里更改--storage.tsdb.retention=90d可以延长,或者启动时带上这个参数即可

3.启动prometheus
systemctl daemon-reload
systemctl enable prometheus
systemctl restart prometheus
systemctl status prometheus

安装Redis5
yum install -y https://repo.ius.io/ius-release-el7.rpm
yum install -y redis5
systemctlstart redis
systemctl enable redis

安装mysql5.7??Centos7下快速安装mysql5.7??
安装n9e1.开始安装
mkdir -p /data/soft/n9e
cd /data/soft/n9e
wget https://github.com/didi/nightingale/releases/download/v5.1.0/n9e-5.1.0.tar.gz
## 或者网盘下载 链接: https://caiyun.139.com/m/i?185CDQrtTe7to提取码:EPNW
tar xf n9e-5.1.0.tar.gz
mysql -uroot -p123456 < docker/initsql/a-n9e.sql

2.配置
sed -i "s#1234#123456#g" etc/server.conf
sed -i "s#1234#123456#g" etc/webapi.conf

3.启动配置
sed -i "s#/root/gopath/src/n9e/n9e#/data/soft/n9e/n9e#g" etc/service/n9e-server.service
sed -i "s#/root/gopath/src/n9e#/data/soft/n9e#g" etc/service/n9e-server.service
sed -i "s#/root/gopath/src/n9e/n9e#/data/soft/n9e/n9e#g" etc/service/n9e-webapi.service
sed -i "s#/root/gopath/src/n9e#/data/soft/n9e#g" etc/service/n9e-webapi.service
cp etc/service/n9e-server.service /etc/systemd/system/
cp etc/service/n9e-webapi.service/etc/systemd/system/
systemctl daemon-reload
systemctl enable n9e-server
systemctl restart n9e-server
systemctl status n9e-server
systemctl enable n9e-webapi
systemctl restart n9e-webapi
systemctl status n9e-webapi
## server默认会监听在19000端口,webapi会监听在18000端口

4.登录
http://ip:18000
默认账号root密码root.2020

【夜莺监控5.1单机部署】*官方安装教程:https://n9e.gitee.io/quickstart/standalone/*

    推荐阅读