HyperLedger Fabric 1.4.4搭建基于多节点kafka共识集群

本文介绍了如何修改配置文件,生成HyperLedger Fabric通道创世区块,并通过docker-compose-kafka.yaml文件启动基于多节点Kafka的区块链网络。详细步骤包括配置文件的调整、通道创世区块的生成以及使用Docker Compose启动Kafka共识集群。
摘要由CSDN通过智能技术生成

修改configtx.yaml配置文件

SampleDevModeKafka下增加kafkabroker节点,我增加后的内容如下

SampleDevModeKafka:
        <<: *ChannelDefaults
        Capabilities:
            <<: *ChannelCapabilities
        Orderer:
            <<: *OrdererDefaults
            OrdererType: kafka
            Kafka:
                Brokers:
                - kafka1.example.com:9082
                - kafka2.example.com:9083
                - kafka3.example.com:9084

            Organizations:
            - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Application:
            <<: *ApplicationDefaults
            Organizations:
            - <<: *OrdererOrg
        Consortiums:
            SampleConsortium:
                Organizations:
                - *Org1
                - *Org2

生成通道的创世区块

将原来solo共识的命令改为如下命令
configtxgen -profile SampleDevModeKafka -channelID kafka-channel -outputBlock ./channel-artifacts/genesis.block

docker-compose-kafka.yaml

新建docker-compose-kafka.yaml文件,内容如下:

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#


# NOTE: This is not the way a Kafka cluster would normally be deployed in production, as it is not secure
# and is not fault tolerant. This example is a toy deployment that is only meant to exercise the Kafka code path
# of the ordering service.

version: '2'

services:
  zookeeper1.example.com:
    container_name: zookeeper1.example.com
    hostname
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值