Channel creation failed in Hyperledger Fabric building - docker

I am trying to set up a test hyperledger fabric environment. I am using docker approach.
Orderer and 2 peer nodes started successfully. However, channel creation fails with error. Any help would be greatly appreciated.
Error: Post "https://localhost:7053/participation/v1/channels": dial tcp [::1]:7053: connect: connection refused
===> List out hyperledger docker images
hyperledger/fabric-tools 2.4 545af418d284 3 months ago 489MB
hyperledger/fabric-tools 2.4.7 545af418d284 3 months ago 489MB
hyperledger/fabric-tools latest 545af418d284 3 months ago 489MB
hyperledger/fabric-peer 2.4 d77dd7cfbcd7 3 months ago 64.2MB
hyperledger/fabric-peer 2.4.7 d77dd7cfbcd7 3 months ago 64.2MB
hyperledger/fabric-peer latest d77dd7cfbcd7 3 months ago 64.2MB
hyperledger/fabric-orderer 2.4 77c489caa81b 3 months ago 36.7MB
hyperledger/fabric-orderer 2.4.7 77c489caa81b 3 months ago 36.7MB
hyperledger/fabric-orderer latest 77c489caa81b 3 months ago 36.7MB
hyperledger/fabric-ccenv 2.4 4eb7ee7f4af5 3 months ago 520MB
hyperledger/fabric-ccenv 2.4.7 4eb7ee7f4af5 3 months ago 520MB
hyperledger/fabric-ccenv latest 4eb7ee7f4af5 3 months ago 520MB
hyperledger/fabric-baseos 2.4 b20d2dde6941 3 months ago 6.82MB
hyperledger/fabric-baseos 2.4.7 b20d2dde6941 3 months ago 6.82MB
hyperledger/fabric-baseos latest b20d2dde6941 3 months ago 6.82MB
hyperledger/fabric-ca 1.5 93f19fa873cb 7 months ago 76.5MB
hyperledger/fabric-ca 1.5.5 93f19fa873cb 7 months ago 76.5MB
hyperledger/fabric-ca latest 93f19fa873cb 7 months ago 76.5MB
sudo ./network.sh up
above is conducted successful
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0eec45f8ecd8 hyperledger/fabric-tools:latest "/bin/bash" 3 seconds ago Up Less than a second cli
d511a671b457 hyperledger/fabric-peer:latest "peer node start" 3 seconds ago Exited (1) 1 second ago peer0.org1.example.com
dfd6cf1917ee hyperledger/fabric-peer:latest "peer node start" 3 seconds ago Exited (1) 1 second ago peer0.org2.example.com
05d550a97a73 hyperledger/fabric-orderer:latest "orderer" 3 seconds ago Exited (2) Less than a second ago orderer.example.com
but when comes to the channel creating, error appears
system:mac
Have retried many times, but it is still not working.
thanks!
solutions for this question i searched in stackoverflow, that retry cannot help, include:
reload docker
re-clone
etc.

Related

Setting up Confluent Kafka Community Locally - broker container keeps exiting

I'm trying to setup Kafka locally and facing an issue. Whenever I run docker compose up, all containers are up correctly. After sometime, the broker container stops running for some reason. There is no error in the container logs.
Below is the status of all docker containers:
0c27a63bb0e7 confluentinc/ksqldb-examples:5.5.1 "bash -c 'echo Waiti…" 6 minutes ago Up 6 minutes ksql-datagen
4e4a30204ccc confluentinc/cp-ksqldb-cli:5.5.1 "/bin/sh" 6 minutes ago Up 6 minutes ksqldb-cli
61b86ff2a6d6 confluentinc/cp-ksqldb-server:5.5.1 "/etc/confluent/dock…" 6 minutes ago Up 6 minutes (health: starting) 0.0.0.0:8088->8088/tcp, :::8088->8088/tcp ksqldb-server
2e022b64a760 cnfldemos/kafka-connect-datagen:0.3.2-5.5.0 "/etc/confluent/dock…" 6 minutes ago Exited (137) 5 minutes ago connect
3c7d273683fb confluentinc/cp-kafka-rest:5.5.1 "/etc/confluent/dock…" 6 minutes ago Exited (137) 5 minutes ago rest-proxy
6b6d36fb9d88 confluentinc/cp-schema-registry:5.5.1 "/etc/confluent/dock…" 6 minutes ago Up 6 minutes 0.0.0.0:8081->8081/tcp, :::8081->8081/tcp schema-registry
3bb20335ecd1 confluentinc/cp-kafka:5.5.1 "/etc/confluent/dock…" 6 minutes ago Exited (137) 5 minutes ago broker
7b2f922ef8ef confluentinc/cp-zookeeper:5.5.1 "/etc/confluent/dock…" 6 minutes ago Up 6 minutes 2888/tcp, 0.0.0.0:2181->2181/tcp, :::2181->2181/tcp, 3888/tcp zookeeper
All I want is a single node Kafka cluster with Schema Registry up and running locally. Any pointers are appreciated.
137 exit code is memory related.
If all you want is Kafka and the Schema Registry, remove KSQLDB stuff, REST Proxy, and DataGen containers
I'd also suggest using a later image tag, such as 7.3.1

What does "in use" mean for an image?

What does "in use" mean and how can I get that info from the CLI?
Reference: docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.State}}\t{{.Image}}"
CONTAINER ID
NAMES
STATE
IMAGE
07bce6924796
laughing_wozniak
exited
vsc-volume-bootstrap
6d37d8744a77
angry_brahmagupta
exited
vsc-quickstarts-d91f349952ba5208420f1403c31b2955-uid
0bce117a827c
dapr_placement
running
daprio/dapr:1.5.0
1232bf715593
dapr_zipkin
running
openzipkin/zipkin
c128e546a0b6
dapr_redis
running
redis
dc44e1006831
miked
exited
my-first-fsharp-web
ce3cf77a0eb9
minikube
running
gcr.io/k8s-minikube/kicbase:v0.0.28
Reference: docker image ls
REPOSITORY
TAG
IMAGE ID
CREATED
SIZE
vsc-microsoftvscodeinsiders-572e00dcd0f79c5ee8d7d39c18e7c701-features
latest
9f05ea6535d4
12 hours ago
6.36GB
vsc-volume-bootstrap
latest
81646861762b
12 hours ago
180MB
vsc-quickstarts-d91f349952ba5208420f1403c31b2955-uid
latest
453bd2943e10
40 hours ago
9.7GB
vsc-quickstarts-d91f349952ba5208420f1403c31b2955
latest
10de525681a7
40 hours ago
9.7GB
openzipkin/zipkin
latest
6a9714eacfd9
2 days ago
153MB
miked.azurecr.io/my-first-fsharp-web
96e7948ee30c
5 days ago
211MB
my-first-fsharp-web
latest
e36fabe64a1c
5 days ago
211MB
miked.azurecr.io/my-first-fsharp-web
1
e36fabe64a1c
5 days ago
211MB
miked.azurecr.io/my-first-fsharp-web
latest
e36fabe64a1c
5 days ago
211MB
counter-image
latest
22dfe0305c55
7 days ago
208MB
redis
latest
40c68ed3a4d2
8 days ago
113MB
daprio/dapr
1.5.0
bff1855a0302
2 weeks ago
214MB
vsc-azure-container-apps-demo-41dcd784881293406771e08c255554b9
latest
1af591496e8a
4 weeks ago
337MB
gcr.io/k8s-minikube/kicbase
v0.0.28
e2a6c047bedd
8 weeks ago
1.08GB
It indicates if the image is used by a container (running or already stopped).
You cannot get this via the CLI using docker images, but listing the containers docker ps -a you can see the associated image.

how to use the same container which was exited in docker

I had created a lot of containers. I am new to this docker container system.
I do a docker ps -a then I get following result
debian#osboxes:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a6a62181dcf0 python "/bin/bash" About a minute ago Exited (127) 8 seconds ago try1
ed5ef0b8155d 1d1a162a72a6 "/bin/bash" 22 hours ago Exited (0) 22 hours ago pedantic_ellis
19a4eff3b5e5 1d1a162a72a6 "/bin/bash" 22 hours ago Exited (0) 22 hours ago assignment4
30933891f08c eeadc22d21a9 "python3" 22 hours ago Exited (0) 22 hours ago python
ccdab94fd32f 1d1a162a72a6 "/bin/bash" 28 hours ago Exited (0) 24 hours ago confident_wu
ce462ecfc5f2 1d1a162a72a6 "/bin/bash -v /home/…" 28 hours ago Exited (127) 28 hours ago stupefied_grothendieck
6123f134934c 1d1a162a72a6 "/bin/bash" 28 hours ago Exited (1) 28 hours ago stupefied_taussig
0ed23a8112a4 1d1a162a72a6 "/bin/bash" 29 hours ago Exited (0) 29 hours ago vigilant_bartik
c343731b7cde 1d1a162a72a6 "/bin/bash" 30 hours ago Exited (0) 29 hours ago gallant_ardinghelli
2f95d3b4c1b8 1d1a162a72a6 "/bin/bash" 30 hours ago Created nice_hermann
5ebe9f18c744 1d1a162a72a6 "/bin/bash" 46 hours ago Created pensive_easley
c1b43edfafb9 1d1a162a72a6 "/bin/bash" 46 hours ago Exited (1) 22 hours ago adoring_williams
42dea69d1d4e 1d1a162a72a6 "/bin/bash" 46 hours ago Created funny_austin
6f736902e650 1d1a162a72a6 "/bin/bash" 46 hours ago Exited (1) 46 hours ago strange_ride
09306e5ec5d1 1d1a162a72a6 "--name=kaushik" 2 days ago Created pensive_shtern
699fb2a23e1c 1d1a162a72a6 "--name=kaushik" 2 days ago Created sharp_feistel
9f7b29ab512e 1d1a162a72a6 "--name=kaushik" 2 days ago Created elastic_payne2
25bfc74fab3b 1d1a162a72a6 "/bin/bash" 2 days ago Exited (1) 2 days ago festive_einstein
e658dd320297 1d1a162a72a6 "/bin/bash" 2 days ago Exited (255) 2 minutes ago objective_napier
ebae378d9152 1d1a162a72a6 "/bin/bash" 2 days ago Exited (1) 2 days ago brave_ritchie
23c7f4293b30 hadoop-build-1001 "/bin/bash" 2 days ago Exited (0) 2 days ago suspicious_lumiere
5090081f6809 hadoop-build-1001 "/bin/bash" 2 days ago Exited (1) 2 days ago quizzical_keller
425d59be9cbf hadoop-build-1001 "/bin/bash" 2 days ago Exited (0) 2 days ago distracted_lederberg
11c55ce7f011 hadoop-build-1001 "/bin/bash" 2 days ago Created elastic_noyce
1ccaf0477995 hadoop-build-1001 "/bin/bash" 2 days ago Created mystifying_tu
62528115f4b7 hadoop-build-1001 "/bin/bash" 2 days ago Created determined_meninsky
fca64af2f595 hadoop-build-1001 "/bin/bash" 2 days ago Created elastic_goldwasser
eecb3153bded hadoop-build-1001 "/bin/bash" 2 days ago Created cool_cray
30b6d61fcac9 hadoop-build-1001 "/bin/bash" 2 days ago Exited (1) 2 days ago quirky_kapitsa
cf992a8b8286 hadoop-build-1001 "/bin/bash" 2 days ago Created hungry_goldstine
0f9a951f7593 hadoop-build-1001 "/bin/bash" 2 days ago Created crazy_wright
e25dcf8a8be8 hadoop-build-1001 "/bin/bash" 2 days ago Created bold_pasteur
73d068e0d756 hadoop-build-1001 "/bin/bash" 2 days ago Exited (0) 2 days ago condescending_goodall
adda325294cd hadoop-build-1001 "/bin/bash" 2 days ago Exited (0) 2 days ago serene_wilson
75a9a3262505 hadoop-build-1001 "/bin/bash" 2 days ago Exited (0) 2 days ago hardcore_khorana
e38726a74e9b hadoop-build-1001 "/bin/bash" 3 days ago Exited (255) 2 days ago beautiful_clarke
4060dbc85d2d hadoop-build-1001 "/bin/bash" 3 days ago Exited (0) 3 days ago strange_yonath
174509213b30 hadoop-build-1001 "/bin/bash" 8 days ago Exited (255) 7 days ago hadoop-c
fa82c595e214 1d1a162a72a6 "/bin/bash" 8 days ago Exited (0) 8 days ago agitated_edison
4b07fcc45271 python "python3" 2 weeks ago Exited (255) 8 days ago pyC
1cc06f213eb7 abee520343a4 "/bin/sh -c 'apt-get…" 3 months ago Exited (100) 3 months ago compassionate_kowalevski
8c1eb67f7325 1b1c7b120b48 "/bin/sh -c 'cd /opt…" 3 months ago Exited (255) 3 months ago dreamy_jepsen
1406d7476a28 1180f37ef8b1 "/bin/sh -c 'mkdir -…" 3 months ago Exited (35) 3 months ago upbeat_taussig
e88bcf7743e2 f0f5acc11f91 "/bin/sh -c 'apt-get…" 3 months ago Exited (100) 3 months ago tender_cohen
I had made some changes in a container which was created using one of hadoop image as below
debian#osboxes:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
python latest eeadc22d21a9 2 weeks ago 933MB
hadoop-build-1001 latest 1d1a162a72a6 3 months ago 2.02GB
hadoop-build latest 5c1480006f78 3 months ago 1.96GB
ubuntu xenial 5f2bf26e3524 3 months ago 123MB
I powered off the machine and rebooted etc.
I want to know that I made changes to one of the containers say in above output of docker ps -a the container was
25bfc74fab3b 1d1a162a72a6 "/bin/bash" 2 days ago Exited (1)
how can after a reboot etc I connect or start the same container again.
What I am currently doing is
docker run -it 1d1a162a72a6 /bin/bash
I make some changes and run a few python programms. But after a reboot all the changes are gone that means those python files which I had edited I have to copy paste them again in the container and do every thing from scratch.I have to install vim each time and then each time I do apt-get update install softwares and then check edit the programe.
I am not able to understand how to go back to same container which was created moments ago before exiting. What mistake I am doing here?
docker run always starts a new container. You can re-attach to the existing container provided it wasn't started with --rm using docker start:
docker start -ai <CONTAINER_ID>
Notice that you should use container ID, not image ID as a parameter to docker start. See more in Docker help:
$ docker start --help
Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]
Start one or more stopped containers
Options:
-a, --attach Attach STDOUT/STDERR and forward signals
--detach-keys string Override the key sequence for detaching a container
-i, --interactive Attach container's STDIN
I had made some changes in a container... after a reboot all the changes are gone that means those python files which I had edited I have to copy paste them again in the container and do every thing from scratch.I have to install vim each time and then each time I do apt-get update install softwares and then check edit the programe.
Containers are, by definition, immutable. What you were editing was a temporary runtime layer. If the container stopped or exited, you lose those changes.
In order to preserve changes, you must edit the Dockerfile and rebuild the container in order to create those immutable layers that the image contains
Realistically, you'd use a volume mount from the host into the container and edit code locally, which syncs into the container. No need for text editors or repeated apt updates

How can I stop the kafka container?

I setup my kafka containers by follow the tutorial from here: https://success.docker.com/article/getting-started-with-kafka
Then I found that I can't remove the container anymore, even though I tried docker container prune. The containers are still running.
What should I do?
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
caa0b94c1d98 qnib/plain-kafka:1.1.0 "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) broker.2.3fij6pt90qt9sb9aco0i2dpys
b888cb6f783a qnib/plain-kafka:1.1.0 "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) broker.3.xqmjnfnfg7ha46lf6drlrq4ki
dcdda2d778c2 qnib/plain-kafka:1.1.0 "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) broker.1.gtgluxt6q58z2irzgfmu969ba
843def0b24fb qnib/plain-zkui "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) zkui.1.7zks618eae8sp4woc7araydix
d7ced19be88c qnib/plain-kafka-manager:2018-04-25 "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) manager.1.jdu5gnprhr4d982vz50511rhg
a67ac962e682 qnib/plain-zookeeper:2018-04-25 "/usr/local/bin/entr…" 3 minutes ago Up 3 minutes (healthy) 2181/tcp, 2888/tcp, 3888/tcp zookeeper.1.xar7cmdgozdj79orow0bmj3ev
880121f2fee5 qnib/golang-kafka-producer:2018-05-01.5 "kafka-producer" 3 minutes ago Up 3 minutes (healthy) producer.2.hety8za590v1twdgj2byvrmse
b6487d29812e qnib/golang-kafka-producer:2018-05-01.5 "kafka-producer" 3 minutes ago Up 3 minutes (healthy) producer.1.5oz02c8cw5oefc97xbarq5qoa
8b3a81905e90 qnib/golang-kafka-producer:2018-05-01.5 "kafka-producer" 3 minutes ago Up 3 minutes (healthy) producer.3.p8uh3hzr22fgm7u4gl1p3fiyw
I found I have to use docker service rm to remove the service due to the replicas settings.
The prune command doesn't work against running containers. You will need to either stop or kill them.
docker kill caa0b94c1d98

Docker-compose up -d:image not created

I am trying to create a basic web page with docker-compose
This is my yml file
identidock:
build: .
ports:
- "5000:5000"
environment:
ENV: DEV
volumes:
- ./app:/app
When I run
docker-compose up -d
it shows
Starting identidock_identidock_1 ... done
But if I check images
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
identidock_identidock latest b5003205377f 12 days ago 698MB
identidock latest 8eafce868d95 12 days ago 698MB
<none> <none> de77d0555129 13 days ago 698MB
<none> <none> 2f8bfc8f0a95 13 days ago 697MB
<none> <none> a42d37d82f28 2 weeks ago 535MB
<none> <none> 592d8c832533 2 weeks ago 695MB
python 3.4 41f9e544ec6c 2 weeks ago 684MB
It is obvious that new image has not been created.If I to http://localhost:5000/,
I got
Firefox can’t establish a connection to the server at localhost:5000.
This is docker ps -a output
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0414117eadd8 identidock_identidock "/cmd.sh" 12 days ago Exited (255) 11 days ago 9090/tcp, 0.0.0.0:5000->5000/tcp, 9191/tcp blissful_easley
4146fd976547 identidock_identidock:latest "/cmd.sh" 12 days ago Exited (255) 11 days ago 9090/tcp, 9191/tcp agitated_leakey
15d49655b290 identidock_identidock "/cmd.sh" 12 days ago Exited (1) 23 minutes ago identidock_identidock_1
And
docker-compose ps
Name Command State Ports
--------------------------------------------------
identidock_identidock_1 /cmd.sh Exit 1
Why?
The container may not have started. Check docker-compose ps. If the containers listed are not in Up state, then you can use docker-compose logs identidock to view the logs.

Resources