性能文章>Prometheus 服务完整部署>

Prometheus 服务完整部署原创

1年前
271824

1、  防火墙配置

systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld
 

2 、Exporter  节点配置

2 1、Linux  节点

mkdir /home/prometheus
Wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
【linux 节点包下载】
tar -zxvf node_exporter-1.0.1.linux-amd64.tar.gz 【节点解压】
nohup ./node_exporter & 【节点启动】
【启动端口 9100 】
lsof -i: 9100 端口检测
https://github.com/prometheus-community/windows_exporter/releases
【windows 节点包下载】
双击安装之后自启动,启动端口 9182
Cmd 下执行 netstat -ano |findstr “9182”

2.2、Redis  节点

Wget https://github.com/oliver006/redis_exporter/releases/download/v1.9.0/redis_exporter-v1.9.0.linux-amd64.tar.gz
【启动节点】
nohup ./redis_exporter -redis.addr 0.0.0.0:6379 -redis.password 123456
启动端口:9121

3 、Prometheus  环境配置

 

3.1 、 下载安装

wget http://file.ethlink.cn/tools/prometheus.tar.gz
tar -zxvf prometheus.tar.gz

32、 配置文件

 

3.2.1 、节点监听

vim prometheus.yml
Ip  地址为节点地址,端口为节点端口。
Linux  节点端口 9100
Windows  节点端口 9182
Redis  节点端口 9121

3.2.2 、杀死 进程

ps -ef | grep prometheus | grep -v grep | awk '{print $2}' | xargs kill -9

3.2.3 、重启进程

nohup ./prometheus &> daemon &

3.2.4 、节点管理

http://ip:9090/targets
up 为启动状态,down 为中断状态

4 、Grafana  环境配置

 

4.1 、下载地址

https://grafana.com/grafana/download/8.5.4?edition=oss

4.1.1 、ubuntu  安装

wget http://file.ethlink.cn/tools/grafana_7.3.4_amd64.deb
dpkg -i grafana_7.3.4_amd64.deb 【编译 1 次】
dpkg -i grafana_7.3.4_amd64.deb 【编译 2 次】

4.1.2 、centos  版本

wget https://dl.grafana.com/oss/release/grafana-8.5.4-1.x86_64.rpm
sudo yum install grafana-8.5.4-1.x86_64.rpm 【安装】
rpm -ivh grafana-8.5.4-1.x86_64.rpm 【编译】

4.2 、服务启动

/etc/init.d/grafana-server start

4.3 、日志查看

tail -200f /var/log/grafana/grafana.log

4.4、密码重置

cd /var/lib/grafana/

 

点赞收藏
飞天小子

13软件测试,10年性能测试,5年性能培训,10万字性能博主,项目经理,微信uhz2008

请先登录,查看2条精彩评论吧
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步
4
2