Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
408 views
in Technique[技术] by (71.8m points)

hyperledger fabric - Error starting up a network. Nodes in different VM - Failed connecting to orderer0.tec.com:7050 , error: context deadline exceeded

I'm starting up a network, which will have 3 peers and an orderer. I have 4 different Virtual Machines, one for each node.

I follow the Getting Started manual for Hyperledger Fabric. I execute all the steps without any problem. However, after executing the following command peer channel join -b channeldemo.block, I start getting some erros. It seems to me that the previous command is generated well, because I get the following logs:

2017-06-27 08:26:23.247 UTC [channelCmd] executeJoin -> INFO 00a Peer joined the channel!
2017-06-27 08:26:23.247 UTC [main] main -> INFO 00b Exiting.....

But then, after that, I get the following logs in the peer:

peer0.proveedor.com    | 2017-06-27 08:26:29.241 UTC [deliveryClient] StartDeliverForChannel -> DEBU 2d8 This peer will pass blocks from orderer service to other peers for channel canaltraza
peer0.proveedor.com    | 2017-06-27 08:26:32.242 UTC [ConnProducer] NewConnection -> ERRO 2d9 Failed connecting to orderer0.tec.com:7050 , error: context deadline exceeded
peer0.proveedor.com    | 2017-06-27 08:26:32.242 UTC [deliveryClient] connect -> ERRO 2da Failed obtaining connection: Could not connect to any of the endpoints: [orderer0.tec.com:7050]

However, if I start up the network in my localhost, I don't get any error log. After one Peer joins the channel, I get the following messages (there are messages from the peer and the orderer):

peer0.proveedor.com | 2017-06-29 11:17:16.027 UTC [deliveryClient] StartDeliverForChannel -> DEBU 2d8 This peer will pass blocks from orderer service to other peers for channel canaltraza
orderer0.tec.com | 2017-06-29 11:17:16.031 UTC [orderer/main] Deliver -> DEBU c22 Starting new Deliver handler
orderer0.tec.com | 2017-06-29 11:17:16.031 UTC [orderer/common/deliver] Handle -> DEBU c23 Starting new deliver loop
orderer0.tec.com | 2017-06-29 11:17:16.031 UTC [orderer/common/deliver] Handle -> DEBU c24 Attempting to read seek info message
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [policies] GetPolicy -> DEBU c25 Returning policy Readers for evaluation
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func1 -> DEBU c26 0xc42010d530 gate 1498735036032103426 evaluation starts 
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c27 0xc42010d530 signed by 0 principal evaluation starts (used [false])
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c28 0xc42010d530 processing identity 0 with bytes of 0a0950726f766565646f7212f4052d2d2d2d2d424547494e202d2d2d2d2d0a4d49494345444343416265674177494241674952414c595177764d593852483533594d4a7970767977457777436759494b6f5a497a6a3045417749776254454c0a4d416b474131554542684d4356564d78457a415242674e5642416754436b4e6862476c6d62334a7561574578466a415542674e564241635444564e68626942470a636d467559326c7a59323878466a415542674e5642416f544458427962335a6c5a5752766369356a623230784754415842674e5642414d5445474e684c6e42790a62335a6c5a5752766369356a623230774868634e4d5463774e6a49354d4467304d7a41335768634e4d6a63774e6a49334d4467304d7a4133576a42594d5173770a435159445651514745774a56557a45544d4245474131554543424d4b5132467361575a76636d3570595445574d4251474131554542784d4e5532467549455a790a5957356a61584e6a627a45634d426f474131554541784d546347566c636a417563484a76646d566c5a4739794c6d4e766254425a4d424d4742797147534d34390a4167454743437147534d34394177454841304941424b5137324e78684f744648354b62666876744e3068624a484f714d6c56734c37695262794e75626a5264630a785039784554507153313169492b33724b46336f4e622b7679777756555058376335653877616f2b6a46366a5454424c4d41344741315564447745422f7751450a417749486744414d42674e5648524d4241663845416a41414d437347413155644977516b4d434b4149496631483567312b535164576369307753386b536136370a45305a4d4651516944776f426a466978786d48434d416f4743437147534d343942414d43413063414d4551434945497a7451796f476e512f6d74334c685561640a3563585172415a6b5978656b4777524f655947326e6a56694169417a6449472f4f2f4a4f57466e566c50727569567332734844724a676356496f70446a4d76360a64696f4e31773d3d0a2d2d2d2d2d454e44202d2d2d2d2d0a
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [msp/identity] newIdentity -> DEBU c29 Creating identity instance for ID &{Proveedor 0bf7d673709e14cef044e09025b8511a590e2c758697ae07f2eef5283757787d}
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c2a 0xc42010d530 identity 0 does not satisfy principal: The identity is a member of a different MSP (expected Usuario, got Proveedor
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c2b 0xc42010d530 principal evaluation fails
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func1 -> DEBU c2c 0xc42010d530 gate 1498735036032103426 evaluation fails
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func1 -> DEBU c2d 0xc42010d530 gate 1498735036032902403 evaluation starts
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c2e 0xc42010d530 signed by 0 principal evaluation starts (used [false])
orderer0.tec.com | 2017-06-29 11:17:16.032 UTC [cauthdsl] func2 -> DEBU c2f 0xc42010d530 processing identity 0 with bytes of 0a0950726f766565646f7212f4052d2d2d2d2d424547494e202d2d2d2d2d0a4d49494345444343416265674177494241674952414c595177764d593852483533594d4a7970767977457777436759494b6f5a497a6a3045417749776254454c0a4d416b474131554542684d4356564d78457a415242674e5642416754436b4e6862476c6d62334a7561574578466a415542674e564241635444564e68626942470a636d467559326c7a59323878466a415542674e5642416f544458427962335a6c5a5752766369356a623230784754415842674e5642414d5445474e684c6e42790a62335a6c5a5752766369356a623230774868634e4d5463774e6a49354d4467304d7a41335768634e4d6a63774e6a49334d4467304d7a4133576a42594d5173770a435159445651514745774a56557a45544d4245474131554543424d4b5132467361575a76636d3570595445574d4251474131554542784d4e5532467549455a790a5957356a61584e6a627a45634d426f474131554541784d546347566c636a417563484a76646d566c5a4739794c6d4e766254425a4d424d4742797147534d34390a4167454743437147534d34394177454841304941424b5137324e78684f744648354b62666876744e3068624a484f714d6c56734c37695262794e75626a5264630a785039784554507153313169492b33724b46336f4e622b7679777756555058376335653877616f2b6a46366a5454424c4d41344741315564447745422f7751450a417749486744414d42674e5648524d4241663845416a41414d437347413155644977516b4d434b4149496631483567312b535164576369307753386b536136370a45305a4d4651516944776f426a466978786d48434d416f4743437147534d343942414d43413063414d4551434945497a7451796f476e512f6d74334c685561640a3563585172415a6b5978656b4777524f655947326e6a56694169417a6449472f4f2f4a4f57466e566c50727569567332734844724a676356496f70446a4d76360a64696f4e31773d3d0a2d2d2d2d2d454e44202d2d2d2d2d0a
orderer0.tec.com | 2017-06-29 11:17:16.033 UTC [msp/identity] newIdentity -> DEBU c30 Creating identity instance for ID &{Proveedor 0bf7d673709e14cef044e09025b8511a590e2c758697ae07f2eef5283757787d}
orderer0.tec.com | 2017-06-29 11:17:16.033 UTC [msp] SatisfiesPrincipal -> DEBU c31 Checking if identity satisfies MEMBER role for Proveedor
orderer0.tec.com | 2017-06-29 11:17:16.033 UTC [msp] Validate -> DEBU c32 MSP Proveedor validating identity
orderer0.tec.com | 2017-06-29 11:17:16.033 UTC [cauthdsl] func2 -> DEBU c33 0xc42010d530 principal matched by identity 0
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [msp/identity] Verify -> DEBU c34 Verify: digest = 00000000 b0 ac 91 ca 2f e9 0d 5e 0d 48 d0 dc 11 06 3b 53 |..../..^.H....;S| orderer0.tec.com | 00000010 a1 d7 f9 d6 2f fe 7d fb 19 2c 90 cb 0f 67 4a 7e |..../.}..,...gJ~|
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [msp/identity] Verify -> DEBU c35 Verify: sig = 00000000 30 45 02 21 00 99 07 ef f1 72 66 96 f6 bc 5f cf |0E.!.....rf..._.| orderer0.tec.com | 00000010 ca a7 4c fd 86 de a2 5c 9e 87 02 ec 35 be df 8d |..L........5...| orderer0.tec.com | 00000020 65 3f 8a 48 67 02 20 38 6b 1d aa 86 f6 53 9c 76 |e?.Hg. 8k....S.v| orderer0.tec.com | 00000030 c1 10 f7 81 5d 1f 65 9a fd 92 fb 35 84 e1 71 ba |....].e....5..q.| orderer0.tec.com | 00000040 7f ce 14 54 d7 0a a7 |...T...|
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [cauthdsl] func2 -> DEBU c36 0xc42010d530 principal evaluation succeeds for identity 0
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [cauthdsl] func1 -> DEBU c37 0xc42010d530 gate 1498735036032902403 evaluation succeeds
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [orderer/common/sigfilter] Apply -> DEBU c38 Forwarding validly signed message for policy &{%!s(*common.ImplicitMetaPolicy=&{Readers 0}) %!s(int=1) [%!s(*policies.implicitMetaPolicy=&{0xc4201dcde0 1 [0xc42010d2a8 0xc42010d370 0xc42010d408]}) %!s(*policies.implicitMetaPolicy=&{0xc4201dc3a0 1 [0xc42010d228]})]}
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [orderer/common/deliver] Handle -> DEBU c39 [channel: canaltraza] Received seekInfo (0xc42081b260) start: > stop: >
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [fsblkstorage] retrieveBlockByNumber -> DEBU c3a retrieveBlockByNumber() - blockNum = [1]
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [fsblkstorage] newBlockfileStream -> DEBU c3b newBlockfileStream(): filePath=[/var/hyperledger/production/orderer/chains/canaltraza/blockfile_000000], startOffset=[14553]
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU c3c Remaining bytes=[16306], Going to peek [8] bytes
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU c3d Returning blockbytes - length=[16304], placementInfo={fileNum=[0], startOffset=[14553], bytesOffset=[14555]}
orderer0.tec.com | 2017-06-29 11:17:16.034 UTC [orderer/common/deliver] Handle -> DEBU c3e [channel: canaltraza] Delivering block for (0xc42081b260)
peer0.proveedor.com | 2017-06-29 11:17:16.031 UTC [deliveryClient] RequestBlocks -> DEBU 2d9 Starting deliver with block [1] for channel canaltraza
peer0.proveedor.com | 2017-06-29 11:17:16.038 UTC [blocksProvider] DeliverBlocks -> DEBU 2da [canaltraza] Adding payload locally, buffer seqNum = [1], peers number [0] peer0.proveedor.com | 2017-06-29 11:17:16.038 UTC [blocksProvider] DeliverBlocks -> DEBU 2db [canaltraza] Gossiping block [1], peers number [0]
peer0.proveedor.com | 2017-06-29 11:17:16.038 UTC [committer] Commit -> DEBU 2dc Validating block
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error was an internal error of the Peer. The peer couldn't connect to the orderer. It was because of the default configuration of the Docker containers that you create.

When you create a docker container, you define its network. By default, the containers that you create are locaten inside the bridge network. This networks isolates the containers from other containers that are in other hosts.

I changed this configuration to Host, and I don't get the error. It goes well.

  • I commented the default network network: byfn
  • I added the property network_mode: host to each container
  • I define the - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=host

I should read more about docker networks, because there are other posibilities like overlay. I thin that this would be better. Also, I thin that it would be a good idea using docker-machien, but I haven't done it. There is more info about it here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...