当前位置:网站首页>搭建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:
- prometheus
5.启动 prometheus
命令如下:
docker-compose -f docker-compose-prometheus.yaml up -d
启动后即可在浏览器中访问:
和
打开 Grafana 界面
输入账号密码:
默认账号:admin
默认密码:admin
之后会让你设置新密码,设置完成之后登录即可,登陆后添加prometheus数据源完成整个环境搭建部署;
边栏推荐
猜你喜欢
Recommend several easy-to-use MySQL open source clients, it is recommended to collect
Example 043: Scope, class methods and variables
同样是初级测试,凭什么他比我薪资高 5000 块?
(十四)时间延时任务及定时任务
使用注解实现限流
一文教会你快速上手 Vim
驱动程序开发:按键中断之异步通知
vite基础,vite中 `@`符号是不被支持,不用@符号,直接用层级(./,../等)
Little rookie Hebei Unicom induction training essay
goland console shows overlapping problem solution
随机推荐
Dynamic Web Development Fundamentals
驱动程序开发:按键中断之异步通知
快35了,还在“点点点”?那些入行几年的测试点工后来都怎么样了?
基础理解网络模型
《天才基本法》:平行时空的第二次选择,小演员的表现意外出圈
网路编程_调试accept
flutter 创建可增型列表和列表排序
数据仓库建模实践
Software life cycle (the work of each phase of software engineering)
How does a new tester do functional testing?Test thinking is really important
Pen paper records
MongoDB 常用查询语句
PostgreSQL相关语法及指令示例
书法家唐效奇
Research on IC enterprises
互联网公司高频面试题精讲:测试计划和测试方案有什么区别?
flutter异步
第三章 搜索与图论(二)
It's almost 35, still "did a little"?What happened to the test workers who had been in the industry for a few years?
如何使用腾讯字体,已经在什么场合下可以使用该字体?TTTGB-Medium