如何在Hyperledger Fabric基本网络示例中看到完整的订购者日志?

时间:2018-07-26 18:45:55

标签: hyperledger-fabric

我目前正在一个项目中,我需要在Hyperledger Fabric 1.1.0区块链应用程序/基础结构上模拟高吞吐量链代码以进行负载测试,但是首先,我需要确保第一个网络示例正常运行。我拥有所有正确的二进制文件,以及fabric-samples目录的干净下载。当我运行./byfn.sh up时,自动化的端到端测试运行得很顺利,但是我主要关心的是幕后情况。因此,我打开了订购者的日志,但是,除了一些模棱两可的警告之外,它没有给我任何有用的信息:

$ docker logs -f orderer.example.com < config values > 2018-07-26 18:34:42.025 UTC [orderer/common/server] Start -> INFO 006 Beginning to serve requests 2018-07-26 18:34:44.594 UTC [msp] DeserializeIdentity -> INFO 007 Obtaining identity 2018-07-26 18:34:44.595 UTC [msp] DeserializeIdentity -> INFO 008 Obtaining identity 2018-07-26 18:34:44.600 UTC [msp] DeserializeIdentity -> INFO 009 Obtaining identity 2018-07-26 18:34:44.607 UTC [fsblkstorage] newBlockfileMgr -> INFO 00a Getting block information from block storage 2018-07-26 18:34:44.615 UTC [orderer/commmon/multichannel] newChain -> INFO 00b Created and starting new chain mychannel 2018-07-26 18:34:44.830 UTC [msp] DeserializeIdentity -> INFO 00c Obtaining identity 2018-07-26 18:34:50.989 UTC [msp] DeserializeIdentity -> INFO 00d Obtaining identity 2018-07-26 18:34:57.281 UTC [msp] DeserializeIdentity -> INFO 00e Obtaining identity 2018-07-26 18:34:57.526 UTC [msp] DeserializeIdentity -> INFO 00f Obtaining identity 2018-07-26 18:34:57.535 UTC [common/deliver] Handle -> WARN 010 Error reading from 172.18.0.7:33608: rpc error: code = Canceled desc = context canceled 2018-07-26 18:34:57.557 UTC [msp] DeserializeIdentity -> INFO 011 Obtaining identity 2018-07-26 18:34:57.558 UTC [msp] DeserializeIdentity -> INFO 012 Obtaining identity 2018-07-26 18:35:00.661 UTC [msp] DeserializeIdentity -> INFO 013 Obtaining identity 2018-07-26 18:35:00.673 UTC [msp] DeserializeIdentity -> INFO 014 Obtaining identity 2018-07-26 18:35:00.682 UTC [common/deliver] Handle -> WARN 015 Error reading from 172.18.0.7:33624: rpc error: code = Canceled desc = context canceled 2018-07-26 18:35:00.687 UTC [msp] DeserializeIdentity -> INFO 016 Obtaining identity 2018-07-26 18:35:00.688 UTC [msp] DeserializeIdentity -> INFO 017 Obtaining identity 2018-07-26 18:35:20.665 UTC [msp] DeserializeIdentity -> INFO 018 Obtaining identity 2018-07-26 18:35:43.483 UTC [msp] DeserializeIdentity -> INFO 019 Obtaining identity

通常,我期望诸如订购者从对等方接收交易之类的信息,此时它会将它们分组在一起,然后将其发送回对等方,但似乎并没有做任何有用的事情。 (旁注:最终我打算在整个网络上禁用TLS,但是现在我不想在尝试获取订购者日志时弄乱网络)

所以我的直觉是同行中出了点问题,所以我为此整理了日志,一切似乎都很好,但是我得到了一些警告:

$ docker logs -f peer0.org1.example.com < ... > 2018-07-26 17:56:08.518 UTC [gossip/comm] func1 -> WARN 026 peer1.org1.example.com:7051, PKIid:[96 141 193 216 138 109 43 60 154 212 136 174 210 228 71 15 212 18 103 171 228 71 30 210 169 234 137 229 237 185 160 17] isn't responsive: rpc error: code = Canceled desc = context canceled 2018-07-26 17:56:08.518 UTC [gossip/discovery] expireDeadMembers -> WARN 027 Entering [[96 141 193 216 138 109 43 60 154 212 136 174 210 228 71 15 212 18 103 171 228 71 30 210 169 234 137 229 237 185 160 17]] 2018-07-26 17:56:08.518 UTC [gossip/discovery] expireDeadMembers -> WARN 028 Closing connection to Endpoint: peer1.org1.example.com:7051, InternalEndpoint: peer1.org1.example.com:7051, PKI-ID: [96 141 193 216 138 109 43 60 154 212 136 174 210 228 71 15 212 18 103 171 228 71 30 210 169 234 137 229 237 185 160 17], Metadata: [] 2018-07-26 17:56:08.520 UTC [gossip/discovery] expireDeadMembers -> WARN 029 Exiting < ... > 2018-07-26 17:56:21.263 UTC [gossip/service] updateEndpoints -> WARN 036 Failed to update ordering service endpoints, due to Channel with mychannel id was not found 2018-07-26 17:56:21.348 UTC [kvledger] CommitWithPvtData -> INFO 037 Channel [mychannel]: Committed block [1] with 1 transaction(s) 2018-07-26 17:56:24.353 UTC [gossip/service] updateEndpoints -> WARN 038 Failed to update ordering service endpoints, due to Channel with mychannel id was not found < ... >

使用docker cli在此网络上进行交易后,我能够使用预期的功能调用/查询就很好了,但是从订购者日志中我仍然什么也没得到。

我特别想知道对等方上的第二组警告-订购者是否可能存在一些通信错误?我可以确认我在系统范围内使用的频道名称为mychannel,所以我看不出它为什么会给我带来任何问题。

我已经在这里待了整整两天了,我快要崩溃了。在Orderer链码中某处是否缺少某些日志记录级别值?希望对如何在Orderer节点上生成输出有一些见解。谢谢!

1 个答案:

答案 0 :(得分:3)

看起来您提供的日志中的每一行都指示INFO或WARNING,因此似乎根本没有获得DEBUG日志。在撰写文件中,您应该能够使用ORDERER_GENERAL_LOGLEVEL = debug(对于订购者)和CORE_LOGGING_LEVEL = DEBUG(对等对象)环境变量来控制它。