Hyperledger Fabric:尝试通过docker exec更改同级上的日志级别时,“无法创建新连接”

问题描述

我在运行macOS 10.15.7的Mac上的Docker中拥有一个正在运行的IBM Blockchain Platform,并且尝试按照该教程创建应用程序。我已经能够使用VS Code命令创建带有某些事务的智能合约,现在是时候从TypeScript应用程序中进行创建了。为了调试我得到的错误,我想设置对等节点的日志级别。我想以下是我想要的,但是命令失败:

$ docker exec 1OrgLocalFabric_peer0.org1.example.com peer logging setlevel \* debug
Error: admin client Failed to connect to 0.0.0.0:7051: Failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:7051: connect: connection refused"

我的设置如下:

$ docker container ls
CONTAINER ID        IMAGE                                                                                                            COMMAND                  CREATED             STATUS              PORTS                                            NAMES
4ca2bd291ad5        1orglocalfabric-org1peer1-demo-contract-0.0.2-92d1c8b9c0742ebaa0e424a0ccfcf1c780b3beec6331d6a6b8f0a8f973af62fa   "/bin/sh -c 'cd /usr…"   3 hours ago         Up 3 hours                                                           1OrgLocalFabric-Org1Peer1-demo-contract-0.0.2
6703ee38c131        hyperledger/fabric-orderer:1.4.6                                                                                 "orderer"                2 days ago          Up 3 hours          7050/tcp,0.0.0.0:17056-17057->17056-17057/tcp   1OrgLocalFabric_orderer.example.com
dae57af8c671        hyperledger/fabric-ca:1.4.6                                                                                      "sh -c 'fabric-ca-se…"   2 days ago          Up 3 hours          7054/tcp,0.0.0.0:17055->17055/tcp               1OrgLocalFabric_ca.orderer.example.com
7cdcc957d720        hyperledger/fabric-peer:1.4.6                                                                                    "peer node start"        2 days ago          Up 3 hours          0.0.0.0:17051-17053->17051-17053/tcp             1OrgLocalFabric_peer0.org1.example.com
9f7a54e23208        couchdb:2.3.1                                                                                                    "tini -- /docker-ent…"   2 days ago          Up 3 hours          4369/tcp,9100/tcp,0.0.0.0:17054->5984/tcp      1OrgLocalFabric_couchdb0.org1.example.com
5546c72bbeae        hyperledger/fabric-ca:1.4.6                                                                                      "sh -c 'fabric-ca-se…"   2 days ago          Up 3 hours          7054/tcp,0.0.0.0:17050->17050/tcp               1OrgLocalFabric_ca.org1.example.com

似乎有些奇怪的是:

  • 使用了17051周围的端口,但失败的端口是7051。我在某处错过了1吗?
  • 以下没有TCP问题:
$ docker exec 1OrgLocalFabric_peer0.org1.example.com peer logging setlevel -h
Adds the logger and log level to the current logging specification.

Usage:
  peer logging setlevel <logger> <log level> [flags]

Flags:
  -h,--help   help for setlevel

我的对等容器在启动时显示以下日志。

$ docker logs --since "2020-10-23T14:39:15" 7cdcc957d720
2020-10-23 14:39:14.406 UTC [nodeCmd] serve -> INFO 001 Starting peer:
 Version: 1.4.6
 Commit SHA: 635fa7bc8
 Go version: go1.12.12
 OS/Arch: linux/amd64
 Chaincode:
  Base Image Version: 0.4.18
  Base Docker Namespace: hyperledger
  Base Docker Label: org.hyperledger.fabric
  Docker Namespace: hyperledger
2020-10-23 14:39:14.407 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2020-10-23 14:39:14.407 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2020-10-23 14:39:14.421 UTC [kvledger] NewProvider -> INFO 004 ledger provider Initialized
2020-10-23 14:39:14.452 UTC [ledgermgmt] initialize -> INFO 005 ledger mgmt initialized
2020-10-23 14:39:14.452 UTC [peer] func1 -> INFO 006 Auto-detected peer address: 172.18.0.4:7051
2020-10-23 14:39:14.452 UTC [peer] func1 -> INFO 007 Host is 0.0.0.0,falling back to auto-detected address: 172.18.0.4:7051
2020-10-23 14:39:14.453 UTC [peer] func1 -> INFO 008 Auto-detected peer address: 172.18.0.4:7051
2020-10-23 14:39:14.453 UTC [peer] func1 -> INFO 009 Host is 0.0.0.0,falling back to auto-detected address: 172.18.0.4:7051
2020-10-23 14:39:14.454 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00a Entering computeChaincodeEndpoint with peerHostname: 172.18.0.4
2020-10-23 14:39:14.454 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00b Exit with ccEndpoint: 172.18.0.4:17052
2020-10-23 14:39:14.454 UTC [sccapi] registerSysCC -> INFO 00c system chaincode lscc(github.com/hyperledger/fabric/core/scc/lscc) registered
2020-10-23 14:39:14.455 UTC [sccapi] registerSysCC -> INFO 00d system chaincode cscc(github.com/hyperledger/fabric/core/scc/cscc) registered
2020-10-23 14:39:14.455 UTC [sccapi] registerSysCC -> INFO 00e system chaincode qscc(github.com/hyperledger/fabric/core/scc/qscc) registered
2020-10-23 14:39:14.455 UTC [sccapi] registerSysCC -> INFO 00f system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle,true) disabled
2020-10-23 14:39:14.458 UTC [gossip.service] func1 -> INFO 010 Initialize gossip with endpoint 172.18.0.4:7051 and bootstrap set [peer0.org1.example.com:17051]
2020-10-23 14:39:14.463 UTC [gossip.gossip] NewGossipService -> INFO 011 Creating gossip service with self membership of Endpoint: peer0.org1.example.com:17051,InternalEndpoint: 172.18.0.4:7051,PKI-ID: 2a820df597b43bf22f446729873a80e9b0718415d6eed8fe26b5e0abe6ee9866,Metadata:
2020-10-23 14:39:14.464 UTC [gossip.gossip] start -> INFO 012 Gossip instance 172.18.0.4:7051 started
2020-10-23 14:39:14.464 UTC [sccapi] deploySysCC -> INFO 013 system chaincode lscc/(github.com/hyperledger/fabric/core/scc/lscc) deployed
2020-10-23 14:39:14.465 UTC [cscc] Init -> INFO 014 Init CSCC
2020-10-23 14:39:14.465 UTC [sccapi] deploySysCC -> INFO 015 system chaincode cscc/(github.com/hyperledger/fabric/core/scc/cscc) deployed
2020-10-23 14:39:14.466 UTC [qscc] Init -> INFO 016 Init QSCC
2020-10-23 14:39:14.466 UTC [sccapi] deploySysCC -> INFO 017 system chaincode qscc/(github.com/hyperledger/fabric/core/scc/qscc) deployed
2020-10-23 14:39:14.466 UTC [sccapi] deploySysCC -> INFO 018 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle) disabled
2020-10-23 14:39:14.466 UTC [nodeCmd] serve -> INFO 019 Deployed system chaincodes
2020-10-23 14:39:14.467 UTC [peer] Initialize -> INFO 01a Loading chain mychannel
2020-10-23 14:39:14.467 UTC [ledgermgmt] OpenLedger -> INFO 01b opening ledger with id = mychannel
2020-10-23 14:39:14.478 UTC [ledgermgmt] OpenLedger -> INFO 01c Opened ledger with id = mychannel
2020-10-23 14:39:14.483 UTC [gossip.gossip] JoinChan -> INFO 01d Joining gossip network of channel mychannel with 1 organizations
2020-10-23 14:39:14.483 UTC [gossip.gossip] learnAnchorPeers -> INFO 01e Learning about the configured anchor peers of Org1MSP for channel mychannel : [{peer0.org1.example.com 17051}]
2020-10-23 14:39:14.483 UTC [gossip.gossip] learnAnchorPeers -> INFO 01f Anchor peer with same endpoint,skipping connecting to myself
2020-10-23 14:39:14.490 UTC [gossip.state] NewGossipStateProvider -> INFO 020 Updating Metadata information for channel mychannel,current ledger sequence is at = 5,next expected block is = 6
2020-10-23 14:39:14.492 UTC [sccapi] deploySysCC -> INFO 021 system chaincode lscc/mychannel(github.com/hyperledger/fabric/core/scc/lscc) deployed
2020-10-23 14:39:14.492 UTC [cscc] Init -> INFO 022 Init CSCC
2020-10-23 14:39:14.492 UTC [sccapi] deploySysCC -> INFO 023 system chaincode cscc/mychannel(github.com/hyperledger/fabric/core/scc/cscc) deployed
2020-10-23 14:39:14.493 UTC [qscc] Init -> INFO 024 Init QSCC
2020-10-23 14:39:14.493 UTC [sccapi] deploySysCC -> INFO 025 system chaincode qscc/mychannel(github.com/hyperledger/fabric/core/scc/qscc) deployed
2020-10-23 14:39:14.493 UTC [sccapi] deploySysCC -> INFO 026 system chaincode (+lifecycle,github.com/hyperledger/fabric/core/chaincode/lifecycle) disabled
2020-10-23 14:39:14.502 UTC [discovery] NewService -> INFO 027 Created with config TLS: false,authCacheMaxSize: 1000,authCachePurgeRatio: 0.750000
2020-10-23 14:39:14.502 UTC [nodeCmd] registerdiscoveryService -> INFO 028 discovery service activated
2020-10-23 14:39:14.503 UTC [nodeCmd] serve -> INFO 029 Starting peer with ID=[name:"Org1Peer1" ],network ID=[1OrgLocalFabric],address=[172.18.0.4:7051]
2020-10-23 14:39:14.503 UTC [nodeCmd] serve -> INFO 02a Started peer with ID=[name:"Org1Peer1" ],address=[172.18.0.4:7051]
2020-10-23 14:39:14.504 UTC [kvledger] LoadPreResetHeight -> INFO 02b Loading prereset height from path [/var/hyperledger/production/ledgersData/chains]
2020-10-23 14:39:14.504 UTC [fsblkstorage] LoadPreResetHeight -> INFO 02c Loading Pre-reset heights
2020-10-23 14:39:14.504 UTC [fsblkstorage] preRestHtFiles -> INFO 02d Found ledgers - [mychannel]
2020-10-23 14:39:14.504 UTC [fsblkstorage] LoadPreResetHeight -> INFO 02e Pre-reset heights loaded
2020-10-23 14:39:20.495 UTC [gossip.election] beleader -> INFO 02f 2a820df597b43bf22f446729873a80e9b0718415d6eed8fe26b5e0abe6ee9866 : Becoming a leader
2020-10-23 14:39:20.495 UTC [gossip.service] func1 -> INFO 030 Elected as a leader,starting delivery service for channel mychannel
2020-10-23 14:39:20.495 UTC [deliveryClient] StartDeliverForChannel -> INFO 031 This peer will retrieve blocks from ordering service and disseminate to other peers in the organization for channel mychannel
2020-10-23 14:39:20.500 UTC [deliveryClient] RequestBlocks -> INFO 032 Starting deliver with block [6] for channel mychannel

我在一开始就注意到了这些行,但是我不知道如何解释它们:

2020-10-23 14:39:14.452 UTC [peer] func1 -> INFO 006 Auto-detected peer address: 172.18.0.4:7051
2020-10-23 14:39:14.452 UTC [peer] func1 -> INFO 007 Host is 0.0.0.0,falling back to auto-detected address: 172.18.0.4:7051

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...