运维学习CentOS 7进行Nightingale二进制部署

.因为Nightingale需要MySQL保存一些数据,所以可以参考《CentOS 7.6使用mysql-8.0.31-1.el7.x86_64.rpm-bundle.tar安装Mysql 8.0》部署MySQL。
https://github.com/ccfos/nightingale/releases是可以github上下载Nightingale二进制安装包。

https://n9e.github.io/docs/install/binary/是二进制部署的说明。

nohup wget https://github.com/ccfos/nightingale/releases/download/v6.1.0/n9e-v6.1.0-linux-amd64.tar.gz &下载文件,下载完成会显示。

ps -aux | grep 13094只有一条消息,并且tail -n 3 nohup.out'n9e-v6.1.0-linux-amd64.tar.gz' saved [43411688/43411688]这样的字样显示,就表明已经下载完成。

mkdir /opt/n9e && tar -zxf n9e-v6.1.0-linux-amd64.tar.gz -C /opt/n9e创建一个/opt/n9e目录,并把相关文件解压到/opt/n9e里边。

chmod 700 /opt/n9e把读写执行权限赋予文件属主。

cd /opt/n9e进入到目录里边。

mysql -ugooduser -pGood#1103 < n9e.sql初始化MySQL数据库里边数据。

nohup ./n9e &> n9e.log &后台运行。

ss -tlnp|grep 17000查看一下监控端口状态,发现没有数据,说明nohup ./n9e &> n9e.log &没有执行成功。

cat n9e.log看一下错误原因,发现如下:

bash 复制代码
[error] failed to initialize database, got error Error 1045: Access denied for user 'root'@'localhost' (using password: YES)
2023/09/16 18:02:58 main.go:36: failed to initialize: Error 1045: Access denied for user 'root'@'localhost' (using password: YES)

/opt/n9e/etc/config.toml第86行内容改为DSN="gooduser:Good#1103@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"

安装Redis

参考【滴滴开源运维监控系统】夜莺V5版本部署实践安装Redis。
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm安装yum源。

sudo yum --enablerepo=remi install redis-5.0.3

/usr/lib/systemd/system/redis.service里边的内容如下:

bash 复制代码
[Unit]
Description=Redis persistent key-value database
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop=/usr/libexec/redis-shutdown
Type=notify
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755

[Install]
WantedBy=multi-user.target

systemctl enable redis允许redis开机自启动。

sed -i '/^# requirepass/a\requirepass GoodLearn#3' /etc/redis.conf在以# requirepass开头的内容下一行插入requirepass GoodLearn#3

cat -n /etc/redis.conf | grep requirepass查看一下上边插入情况。

systemctl start redis开启redissystemctl status redis可以看到redis的状态是active (running)

nohup /opt/n9e/n9e &>> /opt/n9e/n9e.log &后台运行,ss -tlnp|grep 17000查看一下监控端口状态,发现输出了[1]+ Exit 1 nohup /opt/n9e/n9e &>>/opt/n9e/n9e.log,这样的话,就是没有启动成功。

sed -i 's/# Password = ""/Password = "GoodLearn#3"/g' /opt/n9e/etc/config.toml# Password = ""替换成Password = "GoodLearn#3"

安装VictoriaMetrics

参考《【夜莺监控】初识夜莺,强!》《夜莺监控V6初探》安装VictoriaMetrics。
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.90.0/victoria-metrics-linux-amd64-v1.90.0.tar.gz下载时序库。

mkdir /opt/victoria-metrics创建目录。

tar xf victoria-metrics-linux-amd64-v1.90.0.tar.gz -C /opt/victoria-metrics/进行解压。

nohup /opt/victoria-metrics/victoria-metrics-prod &>> /opt/victoria-metrics/victoria.log &启动victoria-metrics-prod

ps -aux | grep victoria-metrics-prod有两条数据,说明正常启动。

sed -i 's#9090/api/v1/write#8428/api/v1/write#g' /opt/n9e/etc/config.toml9090/api/v1/write改成8428/api/v1/write

此文章为10月Day 21学习笔记,内容来源于极客时间《运维监控系统实战笔记》

相关推荐
hsjcjh2 小时前
Nodemailer使用教程:在Node.js中发送电子邮件
linux·运维·node.js
没有梦想的咸鱼185-1037-16633 小时前
北斗高精度数据解算:破解城市峡谷/长基线/无网区难题,从毫米级定位到自动化交付——(GAMIT/GLOBK底层核心解算技术方法)
运维·arcgis·数据分析·自动化
不怕犯错,就怕不做3 小时前
linux 如何查看自己的帐号密码及samba的帐号和密码
linux·运维·服务器
实在智能RPA3 小时前
Agent 在物流行业能实现哪些自动化?——深度拆解 AI Agent 驱动的智慧物流新范式
运维·人工智能·ai·自动化
张3234 小时前
Linux 启动过程
linux·运维
李彦亮老师(本人)4 小时前
Rocky Linux 9.x 新特性详解
linux·运维·服务器·centos·rocky linux
芳草萋萋鹦鹉洲哦6 小时前
【windows】nginx如何注册为开机自启的服务(WinSW实现)
运维·windows·nginx
猩猩—点灯7 小时前
部署远程利器-RustDesk
运维·服务器·网络
biubiubiu07067 小时前
Linux 中 `source` 和 `systemctl daemon-reload` 的区别与踩坑点
linux·运维·服务器