Skip to content

Commit b62d5bd

Browse files
author
Simon Stone
committedAug 8, 2019
[FAB-16132] Remove Kafka consensus from BYFN
Remove Kafka as a consensus mechanism option in BYFN, including all related configuration. Users wishing to configure Kafka (not best practice) in Fabric v2.0 can consult the Fabric v1.4 and earlier samples. Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: I3bbffc876a6b64831cb6b2bdfac28a88cc013bdf
1 parent 3996db5 commit b62d5bd

File tree

6 files changed

+7
-100
lines changed

6 files changed

+7
-100
lines changed
 

‎ci.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FAB_IMAGES_LIST=ca peer orderer ccenv tools baseos nodeenv javaenv
77
# Set fabric if you would like pull only fabric binaries
88
FAB_BINARY_REPO=fabric fabric-ca
99
# Pull below list of images from Hyperledger DockerHub
10-
FAB_THIRDPARTY_IMAGES_LIST=kafka zookeeper couchdb
10+
FAB_THIRDPARTY_IMAGES_LIST=couchdb
1111
# Pull latest binaries of latest commit of release-1.4 from nexus snapshots
1212
# Applicable only when set IMAGE_SOURCE to "nexus"
1313
FAB_BINARY_VER=latest

‎first-network/base/peer-base.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ services:
4040
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
4141
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
4242
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
43-
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
44-
- ORDERER_KAFKA_VERBOSE=true
4543
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
4644
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
4745
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]

‎first-network/byfn.sh

+4-19
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function printHelp() {
4848
echo " -f <docker-compose-file> - specify which docker-compose file use (defaults to docker-compose-cli.yaml)"
4949
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
5050
echo " -l <language> - the programming language of the chaincode to deploy: go (default), javascript, or java"
51-
echo " -o <consensus-type> - the consensus-type of the ordering service: solo (default), kafka, or etcdraft"
51+
echo " -o <consensus-type> - the consensus-type of the ordering service: solo (default) or etcdraft"
5252
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
5353
echo " -a - launch certificate authorities (no certificate authorities are launched by default)"
5454
echo " -n - do not deploy chaincode (abstore chaincode is deployed by default)"
@@ -164,9 +164,7 @@ function networkUp() {
164164
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
165165
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
166166
fi
167-
if [ "${CONSENSUS_TYPE}" == "kafka" ]; then
168-
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_KAFKA}"
169-
elif [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
167+
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
170168
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
171169
fi
172170
if [ "${IF_COUCHDB}" == "couchdb" ]; then
@@ -179,12 +177,6 @@ function networkUp() {
179177
exit 1
180178
fi
181179

182-
if [ "$CONSENSUS_TYPE" == "kafka" ]; then
183-
sleep 1
184-
echo "Sleeping 10s to allow $CONSENSUS_TYPE cluster to complete booting"
185-
sleep 9
186-
fi
187-
188180
if [ "$CONSENSUS_TYPE" == "etcdraft" ]; then
189181
sleep 1
190182
echo "Sleeping 15s to allow $CONSENSUS_TYPE cluster to complete booting"
@@ -222,9 +214,7 @@ function upgradeNetwork() {
222214
export BYFN_CA1_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org1.example.com/ca && ls *_sk)
223215
export BYFN_CA2_PRIVATE_KEY=$(cd crypto-config/peerOrganizations/org2.example.com/ca && ls *_sk)
224216
fi
225-
if [ "${CONSENSUS_TYPE}" == "kafka" ]; then
226-
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_KAFKA}"
227-
elif [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
217+
if [ "${CONSENSUS_TYPE}" == "etcdraft" ]; then
228218
COMPOSE_FILES="${COMPOSE_FILES} -f ${COMPOSE_FILE_RAFT2}"
229219
fi
230220
if [ "${IF_COUCHDB}" == "couchdb" ]; then
@@ -274,8 +264,7 @@ function upgradeNetwork() {
274264
# Tear down running network
275265
function networkDown() {
276266
# stop org3 containers also in addition to org1 and org2, in case we were running sample to add org3
277-
# stop kafka and zookeeper containers in case we're running with kafka consensus-type
278-
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_KAFKA -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_CA -f $COMPOSE_FILE_ORG3 down --volumes --remove-orphans
267+
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_CA -f $COMPOSE_FILE_ORG3 down --volumes --remove-orphans
279268

280269
# Don't remove the generated artifacts -- note, the ledgers are always removed
281270
if [ "$MODE" != "restart" ]; then
@@ -425,8 +414,6 @@ function generateChannelArtifacts() {
425414
set -x
426415
if [ "$CONSENSUS_TYPE" == "solo" ]; then
427416
configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
428-
elif [ "$CONSENSUS_TYPE" == "kafka" ]; then
429-
configtxgen -profile SampleDevModeKafka -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
430417
elif [ "$CONSENSUS_TYPE" == "etcdraft" ]; then
431418
configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
432419
else
@@ -495,8 +482,6 @@ COMPOSE_FILE=docker-compose-cli.yaml
495482
COMPOSE_FILE_COUCH=docker-compose-couch.yaml
496483
# org3 docker compose file
497484
COMPOSE_FILE_ORG3=docker-compose-org3.yaml
498-
# kafka and zookeeper compose file
499-
COMPOSE_FILE_KAFKA=docker-compose-kafka.yaml
500485
# two additional etcd/raft orderers
501486
COMPOSE_FILE_RAFT2=docker-compose-etcdraft2.yaml
502487
# certificate authorities compose file

‎first-network/configtx.yaml

+1-32
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Application: &ApplicationDefaults
220220
Orderer: &OrdererDefaults
221221

222222
# Orderer Type: The orderer implementation to start
223-
# Available types are "solo" and "kafka"
223+
# Available types are "solo" and "etcdraft"
224224
OrdererType: solo
225225

226226
Addresses:
@@ -244,12 +244,6 @@ Orderer: &OrdererDefaults
244244
# max bytes will result in a batch larger than preferred max bytes.
245245
PreferredMaxBytes: 512 KB
246246

247-
Kafka:
248-
# Brokers: A list of Kafka brokers to which the orderer connects
249-
# NOTE: Use IP:port notation
250-
Brokers:
251-
- 127.0.0.1:9092
252-
253247
# Organizations is the list of orgs which are defined as participants on
254248
# the orderer side of the network
255249
Organizations:
@@ -339,31 +333,6 @@ Profiles:
339333
Capabilities:
340334
<<: *ApplicationCapabilities
341335

342-
SampleDevModeKafka:
343-
<<: *ChannelDefaults
344-
Capabilities:
345-
<<: *ChannelCapabilities
346-
Orderer:
347-
<<: *OrdererDefaults
348-
OrdererType: kafka
349-
Kafka:
350-
Brokers:
351-
- kafka.example.com:9092
352-
353-
Organizations:
354-
- *OrdererOrg
355-
Capabilities:
356-
<<: *OrdererCapabilities
357-
Application:
358-
<<: *ApplicationDefaults
359-
Organizations:
360-
- <<: *OrdererOrg
361-
Consortiums:
362-
SampleConsortium:
363-
Organizations:
364-
- *Org1
365-
- *Org2
366-
367336
SampleMultiNodeEtcdRaft:
368337
<<: *ChannelDefaults
369338
Capabilities:

‎first-network/docker-compose-kafka.yaml

-43
This file was deleted.

‎first-network/eyfn.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function networkUp () {
127127

128128
# Tear down running network
129129
function networkDown () {
130-
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_KAFKA -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes --remove-orphans
130+
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_RAFT2 -f $COMPOSE_FILE_ORG3 -f $COMPOSE_FILE_COUCH down --volumes --remove-orphans
131131
# Don't remove containers, images, etc if restarting
132132
if [ "$MODE" != "restart" ]; then
133133
#Cleanup the chaincode containers
@@ -233,8 +233,6 @@ COMPOSE_FILE_COUCH=docker-compose-couch.yaml
233233
COMPOSE_FILE_ORG3=docker-compose-org3.yaml
234234
#
235235
COMPOSE_FILE_COUCH_ORG3=docker-compose-couch-org3.yaml
236-
# kafka and zookeeper compose file
237-
COMPOSE_FILE_KAFKA=docker-compose-kafka.yaml
238236
# two additional etcd/raft orderers
239237
COMPOSE_FILE_RAFT2=docker-compose-etcdraft2.yaml
240238
# use go as the default language for chaincode

0 commit comments

Comments
 (0)
Please sign in to comment.