# COPYRIGHT Hello Corp. All Rights Reserved.
#
# Author: Haley
#
version: '2'
services:
z1:
extends:
file: kafka-base.yaml
service: zookeeper
container_name: z1
hostname: z1
environment:
# ID在集合中必须是唯一的并且应该有一个值在1-255之间。
- ZOO_MY_ID=1
# 组成ZK集合的服务器列表。客户端使用的列表必须与ZooKeeper服务器列表所拥有的每一个ZK服务器相匹配。
# 有两个端口号:第一个是追随者用来连接领导者的,第二个是领导人选举。
- ZOO_SERVERS=server.1=z1:2888:3888 server.2=z2:2888:3888 server.3=z3:2888:3888
# volumes:
# - /var/run/:/host/var/run/
z2:
extends:
file: kafka-base.yaml
service: zookeeper
container_name: z2
hostname: z2
environment:
- ZOO_MY_ID=2
- ZOO_SERVERS=server.1=z1:2888:3888 server.2=z2:2888:3888 server.3=z3:2888:3888
z3:
extends:
file: kafka-base.yaml
service: zookeeper
container_name: z3
hostname: z3
environment:
- ZOO_MY_ID=3
- ZOO_SERVERS=server.1=z1:2888:3888 server.2=z2:2888:3888 server.3=z3:2888:3888
k1:
extends:
file: kafka-base.yaml
service: kafka
container_name: k1
hostname: k1
environment:
- KAFKA_BROKER_ID=1
# min.insync.replicas=M --- 设置一个M值(例如1<M<N,查看下面的default.replication.factor)
# 数据提交时会写入至少M个副本(这些数据然后会被同步并且归属到in-sync副本集合或ISR)。
# 其它情况,写入操作会返回一个错误。接下来:
# 1. 如果channel写入的数据多达N-M个副本变的不可用,操作可以正常执行。
# 2. 如果有更多的副本不可用,Kafka不可以维护一个有M数量的ISR集合,因此Kafka停止接收写操作。Channel只有当同步M个副本后才可以重新可以写。
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
# 指向Zookeeper节点的集合,其中包含ZK的集合。
- KAFKA_ZOOKEEPER_CONNECT=z1:2181,z2:2181,z3:2181
depends_on:
- z1
- z2
- z3
k2:
extends:
file: kafka-base.yaml
service: kafka
container_name: k2
hostname: k2
environment:
- KAFKA_BROKER_ID=2
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=z1:2181,z2:2181,z3:2181
depends_on:
- z1
- z2
- z3
k3:
extends:
file: kafka-base.yaml
service: kafka
container_name: k3
hostname: k3
environment:
- KAFKA_BROKER_ID=3
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=z1:2181,z2:2181,z3:2181
depends_on:
- z1
- z2
- z3
k4:
extends:
file: kafka-base.yaml
service: kafka
container_name: k4
hostname: k4
environment:
- KAFKA_BROKER_ID=4
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=z1:2181,z2:2181,z3:2181
depends_on:
- z1
- z2
- z3
orderer1.example.com:
extends:
file: orderer-base.yaml
service: orderer.example.com
container_name: orderer1.example.com
#environment:
#- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
#- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
#- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
#- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
#- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/tls:/var/hyperledger/orderer/tls
depends_on:
- z1
- z2
- z3
- k1
- k2
- k3
- k4
orderer2.example.com:
extends:
file: orderer-base.yaml
service: orderer.example.com
container_name: orderer2.example.com
#environment:
#- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
#- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
#- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
#- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
#- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer2.example.com/tls:/var/hyperledger/orderer/tls
depends_on:
- z1
- z2
- z3
- k1
- k2
- k3
- k4
orderer3.example.com:
extends:
file: orderer-base.yaml
service: orderer.example.com
container_name: orderer3.example.com
#environment:
#- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
#- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
#- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
#- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
#- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
volumes:
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer3.example.com/tls:/var/hyperledger/orderer/tls
depends_on:
- z1
- z2
- z3
- k1
- k2
- k3
- k4
peer0.org1.example.com:
extends:
file: peer-base.yaml
service: peer-base
container_name: peer0.org1.example.com
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
- 7052:7052
- 7053:7053
peer1.org1.example.com:
extends:
file: peer-base.yaml
service: peer-base
container_name: peer1.org1.example.com
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer1.org1.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/etc/hyperledger/fabric/tls
ports:
- 8051:7051
- 8052:7052
- 8053:7053
peer0.org2.example.com:
extends:
file: peer-base.yaml
service: peer-base
container_name: peer0.org2.example.com
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org2.example.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_PEER_LOCALMSPID=Org2MSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.exa
没有合适的资源?快使用搜索试试~ 我知道了~
Hyperledger Fabric kafka配置
4星 · 超过85%的资源 需积分: 14 88 下载量 39 浏览量
2018-03-09
10:44:11
上传
评论 1
收藏 7KB GZ 举报
温馨提示
共7个文件
yaml:6个
sh:1个
Hyperledger Fabric默认使用solo共识,实际上它早就已经支持kafka共识,只是配置相对复杂点儿。该资源就是使用kafka共识的多orderer集群环境下的网络所需要使用的配置文件。你也可以参考下文帮您理解:http://blog.csdn.net/binbinxyz/article/details/79491254
资源推荐
资源详情
资源评论
收起资源包目录
kafka.tar.gz (7个子文件)
kafka
configtx.yaml 6KB
kafka-base.yaml 690B
crypto-config.yaml 4KB
orderer-base.yaml 1KB
scripts
script.sh 9KB
peer-base.yaml 776B
dc-kafka.yaml 10KB
共 7 条
- 1
资源评论
- z49759580002018-05-14不能用资源
- si812cn2018-10-16还没有试过
- qq_394119792019-01-08111111,可以用.....
- ganqing6617752018-09-05可以用~~~~~
binbinxyz
- 粉丝: 453
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功