当前位置:网站首页>搭建Prometheus+Grafana框架监控Hyperledger Fabric的运行
搭建Prometheus+Grafana框架监控Hyperledger Fabric的运行
2022-08-10 03:18:00 【fabric区块链】
前提:
已有可正常运行的Hyperledger Fabric环境,包括已经完成网络环境搭建,链码部署,web应用开发部署,具体的案例或实例可联系博主获取,(企鹅)。846412999 环境搭建必须包含docker等基础环境的安装。
本环境的fabric版本可以是1.4-2.4,博主使用的是经过pbft改造的共识算法的fabric1.4.4版本,并支持tape、caliper进行项目压测,explorer监控等工作;
目标:
实现Prometheus+Grafana框架的搭建,用于监控fabric网络环境,具体的效果图如下:

搭建步骤:
1. 下载所需镜像
docker pull prom/prometheus
docker pull grafana/grafana
2.修改orderer、peer节点
# orderer 节点
environment:
- ORDERER_METRICS_PROVIDER=prometheus
- ORDERER_OPERATIONS_LISTENADDRESS=0.0.0.0:8443
ports:
- 8443:8443
# peer节点
# org1
environment:
- CORE_METRICS_PROVIDER=prometheus
- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:8443
ports:
- 8443:8443
# org2
environment:
- CORE_METRICS_PROVIDER=prometheus
- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:8443
ports:
- 8443:8443修改完成之后重启fabric区块链网络
3.编写 prometheus.yml
global:
scrape_interval: 15s # # 将scrape间隔设置为每15秒。默认为每1分钟
evaluation_interval: 15s # 每15秒评估一次规则。默认为1分钟。
scrape_configs:
- job_name: 'hyperledger-fabric'
static_configs:
- targets: ['orderer.example.com:8443','peer0.org1.example.com:8443','peer0.org2.example.com:8443'] 4.编写 docker-compose-prometheus.yaml
services:
prometheus:
image: prom/prometheus:latest
restart: always
container_name: prometheus # 容器名称
ports:
- 9090:9090 # 确保端口未被占用
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana:latest
restart: always
container_name: grafana
ports:
- 3000:3000
depends_on:
- prometheus5.启动 prometheus
命令如下:
docker-compose -f docker-compose-prometheus.yaml up -d启动后即可在浏览器中访问:
和
打开 Grafana 界面
输入账号密码:
默认账号:admin
默认密码:admin
之后会让你设置新密码,设置完成之后登录即可,登陆后添加prometheus数据源完成整个环境搭建部署;
边栏推荐
- Difference between netstat and ss command
- flutter 创建可增型列表和列表排序
- 关于redis在业务中的应用问题,如何解决?
- MongoDB 常用查询语句
- 网路编程_调试accept
- Robust Real-time LiDAR-inertial Initialization (Real-time Robust LiDAR Inertial Initialization) Paper Learning
- matlab simulink响应谱计算
- program internationalization
- Software life cycle (the work of each phase of software engineering)
- Dijkstra求最短路
猜你喜欢

驱动程序开发:无设备树和有设备树的platform驱动

Evaluation and Construction of Enterprise Network Security Capability from the Sliding Ruler Model

软件测试这些基本类型你知道吗?

nodejs 时钟案例(fs模块),重复使用fs.writeFile方法,旧内容会被覆盖

《天才基本法》:平行时空的第二次选择,小演员的表现意外出圈

Software life cycle (the work of each phase of software engineering)

电话自动拨号在电脑上自动拨打

是什么让训练综合分类网络艰苦?

js原型和原型链以及原型继承

一个刚入行的测试员怎么样做好功能测试?测试思维真的很重要
随机推荐
matlab simulink响应谱计算
金融口译,口译中金融高频词有哪些
使用 requestAnimationFrame 提升 web 性能
二维空间下的向量旋转
超全面的Android面试题汇总
模型部署ONNX学习
goland控制台显示重叠问题解决方案
leetcode-218.天际线问题
Pen paper records
flink 12 源码编译及使用idea运行、debug
【Image Classification】2022-CycleMLP ICLR
It's almost 35, still "did a little"?What happened to the test workers who had been in the industry for a few years?
Flink学习15:Flink自定义数据源
一文教会你快速上手 Vim
软件的生命周期(软件工程各阶段的工作)
nodejs 时钟案例(fs模块),重复使用fs.writeFile方法,旧内容会被覆盖
一个刚入行的测试员怎么样做好功能测试?测试思维真的很重要
如何让导电滑环信号更好
program internationalization
维度表设计