当前位置:网站首页>搭建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数据源完成整个环境搭建部署;
边栏推荐
猜你喜欢
随机推荐
Kotlin协程:父子协程的绑定与传递
netstat和ss命令区别
applet wxs
基础理解网络模型
嵌入式分享合集32
flex 的 三个参数:flex-grow、flex-shrink、flex-basis
Flink Table&Sql API使用遇到的问题总结
HACKTHEBOX——Bank
从零开始配置 vim(10)——快捷键配置
Basic understanding of network models
动态网页开发基础
驱动程序开发:按键中断之异步通知
全面深入了解什么是反向代理和负载均衡
Take you to an in-depth understanding of the version update of 3.4.2, what does it bring to users?
How does a new tester do functional testing?Test thinking is really important
golang中的URL 的编码和解码(转)
请教各位confluence部署连接数据库成功,但是在后面建表设置的时候报错
【每日一题】大佬们进来看看吧
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
如何快速成为一名软件测试工程师?测试员月薪15k需要什么技术?









