夜莺监控5.1单机部署
Posted feko大魔王
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了夜莺监控5.1单机部署相关的知识,希望对你有一定的参考价值。
环境版本
- centos7
- mysql5.7
- redis5
- prometheus-2.28.0
centos7 简单初始化
yum install wget lrzsz -y
systemctl stop firewalld
systemctl disable 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
安装Prometheus
1.安装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
mv prometheus-2.32.1.linux-amd64 prometheus
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
systemctl start redis
systemctl enable redis
安装mysql5.7
安装n9e
1.开始安装
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
*官方安装教程:https://n9e.gitee.io/quickstart/standalone/*
以上是关于夜莺监控5.1单机部署的主要内容,如果未能解决你的问题,请参考以下文章