docker - Hyperledger测试网络-无法创建新的连接: context deadline exceeded

标签 docker hyperledger-fabric hyperledger

我正在尝试在Hyperledger Fabric示例中的测试网络中创建一个 channel :

localhost:~/fabric-samples/test-network$ ./network.sh createChannel
但是我得到这个错误:
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!

Error !!! Create channel failed
所有容器都在Docker上运行:
localhost:~/fabric-samples/test-network$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS              PORTS                              NAMES
96b7f8e1b2a8        hyperledger/fabric-peer:latest      "peer node start"   5 minutes ago       Up 5 minutes        7051/tcp, 0.0.0.0:9051->9051/tcp   peer0.org2.example.com
79a2c0ac6785        hyperledger/fabric-peer:latest      "peer node start"   5 minutes ago       Up 5 minutes        0.0.0.0:7051->7051/tcp             peer0.org1.example.com
f87e809ddaa4        hyperledger/fabric-orderer:latest   "orderer"           5 minutes ago       Up 5 minutes        0.0.0.0:7050->7050/tcp             orderer.example.com
如果我重新启动网络并尝试创建 channel ,这些是完整的日志:
localhost:~/fabric-samples/test-network$ ./network.sh down
Stopping network

Stopping peer0.org2.example.com ... done
Stopping peer0.org1.example.com ... done
Stopping orderer.example.com    ... done
Removing peer0.org2.example.com ... done
Removing peer0.org1.example.com ... done
Removing orderer.example.com    ... done
Removing network net_test
Removing volume net_orderer.example.com
Removing volume net_peer0.org1.example.com
Removing volume net_peer0.org2.example.com
Removing network net_test
WARNING: Network net_test not found.
Removing volume net_peer0.org3.example.com
WARNING: Volume net_peer0.org3.example.com not found.
---- No containers available for deletion ----
---- No images available for deletion ----
localhost:~/fabric-samples/test-network$ ./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.1.1
DOCKER_IMAGE_VERSION=2.1.1
/home/daniele/fabric-samples/test-network/../bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################

##########################################################
############ Create Org1 Identities ######################
##########################################################
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
+ set +x
##########################################################
############ Create Org2 Identities ######################
##########################################################
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
+ set +x
##########################################################
############ Create Orderer Org Identities ###############
##########################################################
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
+ set +x

Generate CCP files for Org1 and Org2
/home/daniele/fabric-samples/test-network/../bin/configtxgen
#########  Generating Orderer Genesis block ##############
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID system-channel -outputBlock ./system-genesis-block/genesis.block
2020-06-24 17:43:43.129 CEST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-06-24 17:43:43.249 CEST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 Orderer.Addresses unset, setting to [127.0.0.1:7050]
2020-06-24 17:43:43.250 CEST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: etcdraft
2020-06-24 17:43:43.251 CEST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 004 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
2020-06-24 17:43:43.251 CEST [common.tools.configtxgen.localconfig] Load -> INFO 005 Loaded configuration: /home/daniele/fabric-samples/test-network/configtx/configtx.yaml
2020-06-24 17:43:43.257 CEST [common.tools.configtxgen] doOutputBlock -> INFO 006 Generating genesis block
2020-06-24 17:43:43.258 CEST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
+ res=0
+ set +x
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    ... done
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS                  PORTS                              NAMES
6e569adae90d        hyperledger/fabric-orderer:latest   "orderer"           10 seconds ago      Up 4 seconds            0.0.0.0:7050->7050/tcp             orderer.example.com
8cd28fc6db4d        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up 4 seconds            0.0.0.0:7051->7051/tcp             peer0.org1.example.com
c770ba592a1f        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up Less than a second   7051/tcp, 0.0.0.0:9051->9051/tcp   peer0.org2.example.com
localhost:~/fabric-samples/test-network$ ./network.sh createChannel
Creating channel 'mychannel'.

If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb

### Generating channel create transaction 'mychannel.tx' ###
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
2020-06-24 17:44:03.617 CEST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-06-24 17:44:03.764 CEST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/daniele/fabric-samples/test-network/configtx/configtx.yaml
2020-06-24 17:44:03.765 CEST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
2020-06-24 17:44:03.774 CEST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 004 Writing new channel tx
+ res=0
+ set +x

### Generating anchor peer update transactions ###
#######    Generating anchor peer update transaction for Org1MSP  ##########
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2020-06-24 17:44:03.899 CEST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-06-24 17:44:04.022 CEST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/daniele/fabric-samples/test-network/configtx/configtx.yaml
2020-06-24 17:44:04.022 CEST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-06-24 17:44:04.028 CEST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x

#######    Generating anchor peer update transaction for Org2MSP  ##########
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2020-06-24 17:44:04.172 CEST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-06-24 17:44:04.322 CEST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/daniele/fabric-samples/test-network/configtx/configtx.yaml
2020-06-24 17:44:04.322 CEST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Generating anchor peer update
2020-06-24 17:44:04.329 CEST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 004 Writing anchor peer update
+ res=0
+ set +x

Creating channel mychannel
Using organization 1
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/daniele/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/daniele/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/daniele/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
+ peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/daniele/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=1
+ set +x
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: context deadline exceeded
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!

Error !!! Create channel failed
这些是订购者的日志:
2020-06-24 15:43:52.494 UTC [localconfig] completeInitialization -> WARN 001 General.GenesisFile should be replaced by General.BootstrapFile
2020-06-24 15:43:52.497 UTC [localconfig] completeInitialization -> INFO 002 Kafka.Version unset, setting to 0.10.2.0
2020-06-24 15:43:52.497 UTC [orderer.common.server] prettyPrintStruct -> INFO 003 Orderer config values:
        General.ListenAddress = "0.0.0.0"
        General.ListenPort = 7050
        General.TLS.Enabled = true
        General.TLS.PrivateKey = "/var/hyperledger/orderer/tls/server.key"
        General.TLS.Certificate = "/var/hyperledger/orderer/tls/server.crt"
        General.TLS.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
        General.TLS.ClientAuthRequired = false
        General.TLS.ClientRootCAs = []
        General.Cluster.ListenAddress = ""
        General.Cluster.ListenPort = 0
        General.Cluster.ServerCertificate = ""
        General.Cluster.ServerPrivateKey = ""
        General.Cluster.ClientCertificate = "/var/hyperledger/orderer/tls/server.crt"
        General.Cluster.ClientPrivateKey = "/var/hyperledger/orderer/tls/server.key"
        General.Cluster.RootCAs = [/var/hyperledger/orderer/tls/ca.crt]
        General.Cluster.DialTimeout = 5s
        General.Cluster.RPCTimeout = 7s
        General.Cluster.ReplicationBufferSize = 20971520
        General.Cluster.ReplicationPullTimeout = 5s
        General.Cluster.ReplicationRetryTimeout = 5s
        General.Cluster.ReplicationBackgroundRefreshInterval = 5m0s
        General.Cluster.ReplicationMaxRetries = 12
        General.Cluster.SendBufferSize = 10
        General.Cluster.CertExpirationWarningThreshold = 168h0m0s
        General.Cluster.TLSHandshakeTimeShift = 0s
        General.Keepalive.ServerMinInterval = 1m0s
        General.Keepalive.ServerInterval = 2h0m0s
        General.Keepalive.ServerTimeout = 20s
        General.ConnectionTimeout = 0s
        General.GenesisMethod = "file"
        General.GenesisFile = "/var/hyperledger/orderer/orderer.genesis.block"
        General.BootstrapMethod = "file"
        General.BootstrapFile = "/var/hyperledger/orderer/orderer.genesis.block"
        General.Profile.Enabled = false
        General.Profile.Address = "0.0.0.0:6060"
        General.LocalMSPDir = "/var/hyperledger/orderer/msp"
        General.LocalMSPID = "OrdererMSP"
        General.BCCSP.ProviderName = "SW"
        General.BCCSP.SwOpts.SecLevel = 256
        General.BCCSP.SwOpts.HashFamily = "SHA2"
        General.BCCSP.SwOpts.Ephemeral = true
        General.BCCSP.SwOpts.FileKeystore.KeyStorePath = ""
        General.BCCSP.SwOpts.DummyKeystore =
        General.BCCSP.SwOpts.InmemKeystore =
        General.Authentication.TimeWindow = 15m0s
        General.Authentication.NoExpirationChecks = false
        FileLedger.Location = "/var/hyperledger/production/orderer"
        FileLedger.Prefix = "hyperledger-fabric-ordererledger"
        Kafka.Retry.ShortInterval = 5s
        Kafka.Retry.ShortTotal = 10m0s
        Kafka.Retry.LongInterval = 5m0s
        Kafka.Retry.LongTotal = 12h0m0s
        Kafka.Retry.NetworkTimeouts.DialTimeout = 10s
        Kafka.Retry.NetworkTimeouts.ReadTimeout = 10s
        Kafka.Retry.NetworkTimeouts.WriteTimeout = 10s
        Kafka.Retry.Metadata.RetryMax = 3
        Kafka.Retry.Metadata.RetryBackoff = 250ms
        Kafka.Retry.Producer.RetryMax = 3
        Kafka.Retry.Producer.RetryBackoff = 100ms
        Kafka.Retry.Consumer.RetryBackoff = 2s
        Kafka.Verbose = true
        Kafka.Version = 0.10.2.0
        Kafka.TLS.Enabled = false
        Kafka.TLS.PrivateKey = ""
        Kafka.TLS.Certificate = ""
        Kafka.TLS.RootCAs = []
        Kafka.TLS.ClientAuthRequired = false
        Kafka.TLS.ClientRootCAs = []
        Kafka.SASLPlain.Enabled = false
        Kafka.SASLPlain.User = ""
        Kafka.SASLPlain.Password = ""
        Kafka.Topic.ReplicationFactor = 1
        Debug.BroadcastTraceDir = ""
        Debug.DeliverTraceDir = ""
        Consensus = map[SnapDir:/var/hyperledger/production/orderer/etcdraft/snapshot WALDir:/var/hyperledger/production/orderer/etcdraft/wal]
        Operations.ListenAddress = "127.0.0.1:8443"
        Operations.TLS.Enabled = false
        Operations.TLS.PrivateKey = ""
        Operations.TLS.Certificate = ""
        Operations.TLS.RootCAs = []
        Operations.TLS.ClientAuthRequired = false
        Operations.TLS.ClientRootCAs = []
        Metrics.Provider = "disabled"
        Metrics.Statsd.Network = "udp"
        Metrics.Statsd.Address = "127.0.0.1:8125"
        Metrics.Statsd.WriteInterval = 30s
        Metrics.Statsd.Prefix = ""
2020-06-24 15:43:52.534 UTC [orderer.common.server] initializeServerConfig -> INFO 004 Starting orderer with TLS enabled
2020-06-24 15:43:52.547 UTC [fsblkstorage] NewProvider -> INFO 005 Creating new file ledger directory at /var/hyperledger/production/orderer/chains
2020-06-24 15:43:52.571 UTC [orderer.common.server] extractSysChanLastConfig -> INFO 006 Bootstrapping because no existing channels
2020-06-24 15:43:52.590 UTC [orderer.common.server] Main -> INFO 007 Setting up cluster for orderer type etcdraft
2020-06-24 15:43:52.591 UTC [orderer.common.server] reuseListener -> INFO 008 Cluster listener is not configured, defaulting to use the general listener on port 7050
2020-06-24 15:43:52.591 UTC [fsblkstorage] newBlockfileMgr -> INFO 009 Getting block information from block storage
2020-06-24 15:43:52.646 UTC [orderer.consensus.etcdraft] HandleChain -> INFO 00a EvictionSuspicion not set, defaulting to 10m0s
2020-06-24 15:43:52.650 UTC [orderer.consensus.etcdraft] createOrReadWAL -> INFO 00b No WAL data found, creating new WAL at path '/var/hyperledger/production/orderer/etcdraft/wal/system-channel' channel=system-channel node=1
2020-06-24 15:43:52.656 UTC [orderer.commmon.multichannel] Initialize -> INFO 00c Starting system channel 'system-channel' with genesis block hash 7e6f95c1d82bf6a535276ca517cdde2eeb2d8e99d8182e01c15c7ee43df8d08e and orderer type etcdraft
2020-06-24 15:43:52.658 UTC [orderer.consensus.etcdraft] Start -> INFO 00d Starting Raft node channel=system-channel node=1
2020-06-24 15:43:52.659 UTC [orderer.common.cluster] Configure -> INFO 00e Entering, channel: system-channel, nodes: []
2020-06-24 15:43:52.659 UTC [orderer.common.cluster] Configure -> INFO 00f Exiting
2020-06-24 15:43:52.659 UTC [orderer.consensus.etcdraft] start -> INFO 010 Starting raft node as part of a new channel channel=system-channel node=1
2020-06-24 15:43:52.660 UTC [orderer.consensus.etcdraft] becomeFollower -> INFO 011 1 became follower at term 0 channel=system-channel node=1
2020-06-24 15:43:52.660 UTC [orderer.consensus.etcdraft] newRaft -> INFO 012 newRaft 1 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0] channel=system-channel node=1
2020-06-24 15:43:52.660 UTC [orderer.consensus.etcdraft] becomeFollower -> INFO 013 1 became follower at term 1 channel=system-channel node=1
2020-06-24 15:43:52.661 UTC [orderer.common.server] Main -> INFO 014 Starting orderer:
 Version: 2.1.1
 Commit SHA: 6393adb
 Go version: go1.14.1
 OS/Arch: linux/amd64
2020-06-24 15:43:52.664 UTC [orderer.consensus.etcdraft] run -> INFO 015 This node is picked to start campaign channel=system-channel node=1
2020-06-24 15:43:52.673 UTC [orderer.common.server] Main -> INFO 016 Beginning to serve requests
2020-06-24 15:43:52.674 UTC [orderer.consensus.etcdraft] apply -> INFO 017 Applied config change to add node 1, current nodes in channel: [1] channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] Step -> INFO 018 1 is starting a new election at term 1 channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] becomePreCandidate -> INFO 019 1 became pre-candidate at term 1 channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] poll -> INFO 01a 1 received MsgPreVoteResp from 1 at term 1 channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] becomeCandidate -> INFO 01b 1 became candidate at term 2 channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] poll -> INFO 01c 1 received MsgVoteResp from 1 at term 2 channel=system-channel node=1
2020-06-24 15:43:53.674 UTC [orderer.consensus.etcdraft] becomeLeader -> INFO 01d 1 became leader at term 2 channel=system-channel node=1
2020-06-24 15:43:53.675 UTC [orderer.consensus.etcdraft] run -> INFO 01e raft.node: 1 elected leader 1 at term 2 channel=system-channel node=1
2020-06-24 15:43:53.675 UTC [orderer.consensus.etcdraft] run -> INFO 01f Leader 1 is present, quit campaign channel=system-channel node=1
2020-06-24 15:43:53.675 UTC [orderer.consensus.etcdraft] run -> INFO 020 Raft leader changed: 0 -> 1 channel=system-channel node=1
2020-06-24 15:43:53.676 UTC [orderer.consensus.etcdraft] run -> INFO 021 Start accepting requests as Raft leader at block [0] channel=system-channel node=1
有人可以帮助我解决这个问题吗?
更新:我能够绕过在docker子网中用订购者容器的ip替换localhost的问题(在我的情况下为172.28.0.3),我发现这样做:
localhost:~/fabric-samples/test-network$ docker inspect orderer.example.com  -f "{{json .NetworkSettings.Networks }}"
{"net_test":{"IPAMConfig":null,"Links":null,"Aliases":["f3fdd48a7076","orderer.example.com"],"NetworkID":"23b404bac1f2961b721d1348ee21d1886268e7094485f4f46b0509133ac4bca2","EndpointID":"b026cba3dc23cb17ba7f3f89f2a776af2447233b1ddb829136e0bc2df34063b9","Gateway":"172.28.0.1","IPAddress":"172.28.0.3","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:1c:00:03","DriverOpts":null}}
但是,由于容器公开了端口7050,因此我也应该能够连接到localhost,但是我不能。
也许我必须在docker配置中进行一些更改?
更新26/06
来自monitordocker.sh的日志(甚至在启动createChannel之前我都得到了这些错误):
localhost:~/fabric-samples/test-network$ ./monitordocker.sh net_test
Starting monitoring on all containers on the network net_test
ed8fa674c820feae35c2ec8834a4350aca1c1ac590ba677a766fb14281e4fe31
peer0.org2.example.com|2020-06-26 10:08:57.353 UTC [core.comm] ServerHandshake -> ERRO 04b TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.3:35778
peer0.org2.example.com|2020-06-26 10:08:58.354 UTC [core.comm] ServerHandshake -> ERRO 04c TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.3:35780
peer0.org1.example.com|2020-06-26 10:08:58.430 UTC [core.comm] ServerHandshake -> ERRO 04c TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.4:53408
peer0.org1.example.com|2020-06-26 10:08:59.432 UTC [core.comm] ServerHandshake -> ERRO 04d TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.4:53410
peer0.org2.example.com|2020-06-26 10:08:59.641 UTC [core.comm] ServerHandshake -> ERRO 04d TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.3:35786
peer0.org1.example.com|2020-06-26 10:09:00.351 UTC [gossip.discovery] func1 -> WARN 04e Could not connect to Endpoint: peer0.org2.example.com:9051, InternalEndpoint: peer0.org2.example.com:9051, PKI-ID: <nil>, Metadata:  : context deadline exceeded
peer0.org1.example.com|2020-06-26 10:09:00.915 UTC [core.comm] ServerHandshake -> ERRO 04f TLS handshake failed with error remote error: tls: bad certificate server=PeerServer remoteaddress=172.18.0.4:53414
peer0.org2.example.com|2020-06-26 10:09:01.428 UTC [gossip.discovery] func1 -> WARN 04e Could not connect to Endpoint: peer0.org1.example.com:7051, InternalEndpoint: peer0.org1.example.com:7051, PKI-ID: <nil>, Metadata:  : context deadline exceeded
证书似乎有问题,但是我不明白是什么。我从https://hyperledger-fabric.readthedocs.io/en/latest/install.html下载了 Fabric sample ,我以为一切都已经存在了。
更新30/06:Alpine似乎有问题。我按照所有确切步骤尝试了Ubuntu,并且一切正常,所以我认为我将继续使用Ubuntu。
将日志级别设置为DEBUG后的日志:
2020-06-28 10:52:13.832 CEST [msp] getMspConfig -> DEBU 0f7 Intermediate certs folder not found at [/home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/intermediatecerts]. Skipping. [stat /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/intermediatecerts: no such file or directory]
        2020-06-28 10:52:13.833 CEST [msp] getPemMaterialFromDir -> DEBU 0f8 Reading directory /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/tlscacerts
        2020-06-28 10:52:13.834 CEST [msp] getPemMaterialFromDir -> DEBU 0f9 Inspecting file /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
        2020-06-28 10:52:13.835 CEST [msp] getPemMaterialFromDir -> DEBU 0fa Reading directory /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/tlsintermediatecerts
        2020-06-28 10:52:13.836 CEST [msp] getMspConfig -> DEBU 0fb TLS intermediate certs folder not found at [/home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/tlsintermediatecerts]. Skipping. [stat /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/tlsintermediatecerts: no such file or directory]
        2020-06-28 10:52:13.837 CEST [msp] getPemMaterialFromDir -> DEBU 0fc Reading directory /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/crls
        2020-06-28 10:52:13.837 CEST [msp] getMspConfig -> DEBU 0fd crls folder not found at [/home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/crls]. Skipping. [stat /home/daniele/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/msp/crls: no such file or directory]
        2020-06-28 10:52:13.839 CEST [msp] getMspConfig -> DEBU 0fe Loading NodeOUs
        2020-06-28 10:52:13.842 CEST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 0ff Writing anchor peer update
        + res=0
        + set +x
        
        Creating channel mychannel
        Using organization 1
        + peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls --cafile /home/daniele/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
        + res=1
        + set +x

最佳答案

有趣的。我查看了您的日志,没有发现任何明显的问题,并且您已经发现您无法联系到订购者。 。我想检查这是否确实是TLS问题。你能帮我试试吗?

  • fabric-samples/commercial-paper/organization/digibank/configuration/cli/文件夹中应该有一个monitordocker.sh脚本。它的日志记录输出并将所有日志收集在一起,然后将其复制到测试网络。
  • 再次使您的网络瘫痪。
  • 再次使您的网络启动
  • 在单独的终端
  • 中运行./monitordocker.sh net_test
  • 运行./network.sh createChannel,看看是否可以从logspout
  • 中获得更多见解

    关于docker - Hyperledger测试网络-无法创建新的连接: context deadline exceeded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62565167/

    相关文章:

    python - Docker 将目录添加到容器以运行 Flask 应用程序

    docker - 为什么我不能使用 Docker/VScode 进行远程调试?

    hyperledger-fabric - 无法创建 channel - 试图包含不在联盟中的成员

    hyperledger-fabric - 不同需求的Hyperledger Fabric交易背书

    ssl - 由于未知授权机构签署的证书,Chaincode 容器无法连接到本地对等方

    docker - 我想使用 docker-compose volume 指令在多个容器之间共享代码内容

    docker - 在 docker-compose 构建过程中运行 webpack build

    super 账本结构 : No script

    hyperledger-fabric - 如何将新的订购者组织添加到现有的 Hyperledger Fabric 网络

    hyperledger - 如何将区 block 链与 Hyperledger Fabric 连接起来?