使用FabriC语言 samples文件夹启动Hyperledger Fabric测试网络时端口冲突



我是一个新的初学者,已经为这些端口错误挣扎了一段时间当我在目录:fabric-samples/test-network中运行。/network.sh时发生以下端口错误:

yujindeMBP:test-network yujin$ ./network.sh up
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
LOCAL_VERSION=2.3.0
DOCKER_IMAGE_VERSION=2.3.0
/Users/yujin/fabric-samples-with-bis/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
Generating CCP files for Org1 and Org2
Creating network "net_test" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating orderer.example.com    ... error
Creating peer0.org2.example.com ... 
Creating peer0.org1.example.com ... 
Creating peer0.org1.example.com ... error
Creating peer0.org2.example.com ... done
ERROR: for peer0.org1.example.com  Cannot start service peer0.org1.example.com: Ports are not available: listen tcp 0.0.0.0:7051: bind: address already in use
ERROR: for orderer.example.com  Cannot start service orderer.example.com: Ports are not available: listen tcp 0.0.0.0:7050: bind: address already in use
ERROR: for peer0.org1.example.com  Cannot start service peer0.org1.example.com: Ports are not available: listen tcp 0.0.0.0:7051: bind: address already in use
ERROR: Encountered errors while bringing up the project.
CONTAINER ID   IMAGE                               COMMAND             CREATED        STATUS                  PORTS                              NAMES
6feb86580f43   hyperledger/fabric-orderer:latest   "orderer"           1 second ago   Created                                                    orderer.example.com
dbfae1aa4c11   hyperledger/fabric-peer:latest      "peer node start"   1 second ago   Created                                                    peer0.org1.example.com
d0367a0d6089   hyperledger/fabric-peer:latest      "peer node start"   1 second ago   Up Less than a second   7051/tcp, 0.0.0.0:9051->9051/tcp   peer0.org2.example.com

看起来orderer, org1和org2使用相同的端口7050和7051,他们相互冲突了。我想我可以避免这些端口错误通过运行docker。然而,似乎我错了。在运行。/network.sh之前,我检查了docker环境,我确定没有其他进程同时运行。

yujindeMBP:test-network yujin$ docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

在我尝试启动test-network之前,docker的进程表是清空的。

我真的很困惑,需要你的帮助。非常感谢!

Trydocker ps -a此列表列出所有活动容器。使用docker rm -f [container_id/container_name]命令移除容器一旦所有的容器都被移除,然后把你的网络带回来。

如果你仍然面临这个问题,然后去你的crypto-config-org1.yaml,crypto-config-org2.yaml,crypto-config-orderer.yaml编辑并更改端口。你也可以在https://chat.hyperledger.org/上提问

最新更新