kctam / fullgear-4node-setup

A Fabric Network of 3 Orderers with Kafka, 2 Organizations each of which has 2 peers, deployed across 4 nodes.
5 stars 9 forks source link

Why is Kafka container constantly exit? #2

Open daekp opened 5 years ago

daekp commented 5 years ago

I executed continuously command 'docker-compose'. However, kafka containers continue to exit. what's the reason?


user1@host-1:~/fabric-samples/fullgear-4node-setup$ docker-compose -f node1.yaml up -d
WARNING: The Docker Engine you're using is running in swarm mode.
Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.
To deploy your application across the swarm, use 'docker stack deploy'.
ca.org1.example.com is up-to-date
peer0.org1.example.com is up-to-date
zookeeper0 is up-to-date
Starting kafka0 ... done
orderer0.example.com is up-to-date
cli is up-to-date

user1@host-1:~/fabric-samples/fullgear-4node-setup$ docker exec cli peer channel create -o orderer0.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx
2019-08-16 04:58:33.798 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: SERVICE_UNAVAILABLE -- backing Kafka cluster has not completed booting; try again later

user1@host-1:~/fabric-samples/fullgear-4node-setup$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                           
                         NAMES
d7a34cd80a40        hyperledger/fabric-tools       "/bin/bash"              2 hours ago         Up 2 hours                                                          
                         cli
71294f0ce140        hyperledger/fabric-orderer     "orderer"                2 hours ago         Up 2 hours          0.0.0.0:7050->7050/tcp, 0.0.0.0:32770->7050/tcp 
                         orderer0.example.com
b946305da942        hyperledger/fabric-peer        "peer node start"        2 hours ago         Up 2 hours          0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp  
                         peer0.org1.example.com
8648229f8a85        hyperledger/fabric-zookeeper   "/docker-entrypoint.…"   2 hours ago         Up 2 hours          0.0.0.0:2181->2181/tcp, 0.0.0.0:2888->2888/tcp, 
0.0.0.0:3888->3888/tcp   zookeeper0
4f6182ec562f        hyperledger/fabric-ca          "sh -c 'fabric-ca-se…"   2 hours ago         Up 2 hours          0.0.0.0:7054->7054/tcp                          
                         ca.org1.example.com```
daekp commented 5 years ago

I solved this problem. This is because you have not opened the ports associated with kafka and zookeeper. In particular, if you use the cloud, you need to open the firewall port as well as the operating system port.