# Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # version: '2' networks: ca: # attachable: true services: zookeeper0: extends: file: dc-orderer-kafka-base.yml service: zookeeper environment: # ======================================================================== # Reference: https://zookeeper.apache.org/doc/r3.4.9/zookeeperAdmin.html#sc_configuration # ======================================================================== # # myid # The ID must be unique within the ensemble and should have a value # between 1 and 255. - ZOO_MY_ID=1 # # server.x=[hostname]:nnnnn[:nnnnn] # The list of servers that make up the ZK ensemble. The list that is used # by the clients must match the list of ZooKeeper servers that each ZK # server has. There are two port numbers `nnnnn`. The first is what # followers use to connect to the leader, while the second is for leader # election. - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888 zookeeper1: extends: file: dc-orderer-kafka-base.yml service: zookeeper environment: - ZOO_MY_ID=2 - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888 zookeeper2: extends: file: dc-orderer-kafka-base.yml service: zookeeper environment: - ZOO_MY_ID=3 - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888 kafka0: extends: file: dc-orderer-kafka-base.yml service: kafka environment: # ======================================================================== # Reference: https://kafka.apache.org/documentation/#configuration # ======================================================================== # # broker.id - KAFKA_BROKER_ID=0 # # min.insync.replicas # Let the value of this setting be M. Data is considered committed when # it is written to at least M replicas (which are then considered in-sync # and belong to the in-sync replica set, or ISR). In any other case, the # write operation returns an error. Then: # 1. If up to M-N replicas -- out of the N (see default.replication.factor # below) that the channel data is written to -- become unavailable, # operations proceed normally. # 2. If more replicas become unavailable, Kafka cannot maintain an ISR set # of M, so it stops accepting writes. Reads work without issues. The # channel becomes writeable again when M replicas get in-sync. - KAFKA_MIN_INSYNC_REPLICAS=1 # # default.replication.factor # Let the value of this setting be N. A replication factor of N means that # each channel will have its data replicated to N brokers. These are the # candidates for the ISR set of a channel. As we noted in the # min.insync.replicas section above, not all of these brokers have to be # available all the time. In this sample configuration we choose a # default.replication.factor of K-1 (where K is the total number of brokers in # our Kafka cluster) so as to have the largest possible candidate set for # a channel's ISR. We explicitly avoid setting N equal to K because # channel creations cannot go forward if less than N brokers are up. If N # were set equal to K, a single broker going down would mean that we would # not be able to create new channels, i.e. the crash fault tolerance of # the ordering service would be non-existent. - KAFKA_DEFAULT_REPLICATION_FACTOR=1 # # zookeper.connect # Point to the set of Zookeeper nodes comprising a ZK ensemble. - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181 # # zookeeper.connection.timeout.ms # The max time that the client waits to establish a connection to # Zookeeper. If not set, the value in zookeeper.session.timeout.ms (below) # is used. #- KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS = 6000 # # zookeeper.session.timeout.ms #- KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS = 6000 - KAFKA_ADVERTISED_HOST_NAME=172.31.30.169 - KAFKA_ADVERTISED_PORT=32792 depends_on: - zookeeper0 - zookeeper1 - zookeeper2 ports: - "32792:9092" kafka1: extends: file: dc-orderer-kafka-base.yml service: kafka environment: - KAFKA_BROKER_ID=1 - KAFKA_DEFAULT_REPLICATION_FACTOR=1 - KAFKA_MIN_INSYNC_REPLICAS=1 - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181 - KAFKA_ADVERTISED_HOST_NAME=172.31.30.169 - KAFKA_ADVERTISED_PORT=32793 depends_on: - zookeeper0 - zookeeper1 - zookeeper2 ports: - "32793:9092"