Skip to content

Commit

Permalink
A13 Fixes to Kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ananth committed Jul 19, 2018
1 parent 37dc65a commit f6df53a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 52 deletions.
48 changes: 3 additions & 45 deletions composer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
- CONFIGTX_ORDERER_KAFKA_BROKERS=[kafka0:9092, kafka1:9092, kafka2:9092, kafka3:9092]
- CONFIGTX_ORDERER_KAFKA_BROKERS=[{IP-HOST-1}:9092, {IP-HOST-1}:10092]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
ports:
Expand Down Expand Up @@ -199,7 +199,7 @@ services:
- KAFKA_LOG_RETENTION_MS=-1
- KAFKA_ZOOKEEPER_CONNECT={IP-HOST-1}:2181,{IP-HOST-1}:3181,{IP-HOST-1}:4181
ports:
- 9092
- 9092:9092
depends_on:
- zookeeper0
- zookeeper1
Expand All @@ -220,49 +220,7 @@ services:
- KAFKA_LOG_RETENTION_MS=-1
- KAFKA_ZOOKEEPER_CONNECT={IP-HOST-1}:2181,{IP-HOST-1}:3181,{IP-HOST-1}:4181
ports:
- 9092
depends_on:
- zookeeper0
- zookeeper1
- zookeeper2

kafka2:
container_name: kafka2
# image: wurstmeister/kafka:latest
image: hyperledger/fabric-kafka
restart: always
environment:
- KAFKA_MESSAGE_MAX_BYTES=103809024
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_BROKER_ID=2
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_LOG_RETENTION_MS=-1
- KAFKA_ZOOKEEPER_CONNECT={IP-HOST-1}:2181,{IP-HOST-1}:3181,{IP-HOST-1}:4181
ports:
- 9092
depends_on:
- zookeeper0
- zookeeper1
- zookeeper2

kafka3:
container_name: kafka3
# image: wurstmeister/kafka:latest
image: hyperledger/fabric-kafka
restart: always
environment:
- KAFKA_MESSAGE_MAX_BYTES=103809024
- KAFKA_REPLICA_FETCH_MAX_BYTES=103809024
- KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
- KAFKA_BROKER_ID=3
- KAFKA_MIN_INSYNC_REPLICAS=2
- KAFKA_DEFAULT_REPLICATION_FACTOR=3
- KAFKA_LOG_RETENTION_MS=-1
- KAFKA_ZOOKEEPER_CONNECT={IP-HOST-1}:2181,{IP-HOST-1}:3181,{IP-HOST-1}:4181
ports:
- 9092
- 10092:9092
depends_on:
- zookeeper0
- zookeeper1
Expand Down
6 changes: 2 additions & 4 deletions config-all/configtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
PreferredMaxBytes: 512 KB
Kafka:
Brokers:
- kafka0:9092
- kafka1:9092
- kafka2:9092
- kafka3:9092
- {IP-HOST-1}:9092
- {IP-HOST-1}:10092
Organizations:
Application: &ApplicationDefaults
Expand Down
2 changes: 1 addition & 1 deletion config-all/docker-compose-peer-n.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- ORDERER_KAFKA_RETRY_SHORTINTERVAL=1s
- ORDERER_KAFKA_RETRY_SHORTTOTAL=30s
- ORDERER_KAFKA_VERBOSE=true
- CONFIGTX_ORDERER_KAFKA_BROKERS=[kafka0:9092, kafka1:9092]
- CONFIGTX_ORDERER_KAFKA_BROKERS=[{IP-HOST-1}:9092, {IP-HOST-1}:10092, kafka0:9092, kafka1:9092]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
ports:
Expand Down
6 changes: 5 additions & 1 deletion config-all/howtobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
HOSTS = ""
CONFIGTX = ""
CRYPTOCONFIG = ""
PEERNUMBER = ""
PEERADMINCARD = ""
arg1 -= 1
for i in range(arg1):
Expand All @@ -18,6 +19,9 @@
for i in range(arg1):
CRYPTOCONFIG += 'sed -i -e "s/{IP-HOST-' + str(i+2) + '}/$HOST' + str(i+2) + '/g" crypto-config.yaml\n'

for i in range(arg1):
PEERNUMBER += 'sed -i -e "s/{IP-HOST-1}/$HOST1/g" docker-compose-peer' + str(i+2) + '.yaml\n'

for i in range(arg1):
PEERADMINCARD += 'sed -i -e "s/{IP-HOST-' + str(i+2) + '}/$HOST' + str(i+2) + '/g" ../createPeerAdminCard.sh\n'

Expand All @@ -30,7 +34,7 @@
sed -i -e "s/{IP-HOST-1}/$HOST1/g" crypto-config.yaml
""" + CRYPTOCONFIG + """
sed -i -e "s/{IP-HOST-1}/$HOST1/g" docker-compose.yml
sed -i -e "s/{IP-HOST-1}/$HOST1/g" docker-compose-peer2.yml
""" + PEERNUMBER + """
sed -i -e "s/{IP-HOST-1}/$HOST1/g" ../createPeerAdminCard.sh
""" + PEERADMINCARD + """
Expand Down
6 changes: 5 additions & 1 deletion config-all/howtorevert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
HOSTS = ""
CONFIGTX = ""
CRYPTOCONFIG = ""
PEERNUMBER = ""
PEERADMINCARD = ""
arg1 -= 1
for i in range(arg1):
Expand All @@ -18,6 +19,9 @@
for i in range(arg1):
CRYPTOCONFIG += 'sed -i -e "s/$HOST' + str(i+2) + '/{IP-HOST-' + str(i+2) + '}/g" crypto-config.yaml\n'

for i in range(arg1):
PEERNUMBER += 'sed -i -e "s/$HOST1/{IP-HOST-1}/g" docker-compose-peer' + str(i+2) + '.yaml\n'

for i in range(arg1):
PEERADMINCARD += 'sed -i -e "s/$HOST' + str(i+2) + '/{IP-HOST-' + str(i+2) + '}/g" ../createPeerAdminCard.sh\n'

Expand All @@ -30,7 +34,7 @@
sed -i -e "s/$HOST1/{IP-HOST-1}/g" crypto-config.yaml
""" + CRYPTOCONFIG + """
sed -i -e "s/$HOST1/{IP-HOST-1}/g" docker-compose.yml
sed -i -e "s/$HOST1/{IP-HOST-1}/g" docker-compose-peer2.yml
""" + PEERNUMBER + """
sed -i -e "s/$HOST1/{IP-HOST-1}/g" ../createPeerAdminCard.sh
""" + PEERADMINCARD + """
Expand Down

0 comments on commit f6df53a

Please sign in to comment.