【问题标题】:Failed to connect client peer, please check the configuration and peer status连接客户端peer失败,请检查配置和peer状态
【发布时间】:2019-03-04 08:12:26
【问题描述】:

我在使用 Explorer 3.7 和 Fabric 版本 1.2.0 时遇到一个错误。

控制台显示错误:

为网络启动同步过程:[dev] 和客户端:[client] >>>>>>>>>>>>>>>>>>>>>> 错误:['连接客户端对等失败,请检查配置和对等状态'] >>>>>>>>>>>>>>>>>>>>>>

blockchain-explorer/logs/sync/app/app.log 显示错误

[2018-09-28 13:41:10.692] [DEBUG] FabricClient - 通道 [mychannel] >> e520121a6edb2794eb85505d5f5319d29286acb43d0280e0f0f75a130e79889c 的通道创世哈希 [2018-09-28 13:41:10.692] [DEBUG] FabricClient - 初始化通道>> mychannel [2018-09-28 13:41:10.723] [DEBUG] FabricClient - 将客户端 [client-1] 默认排序器设置为 >> grpcs://orderer.yx.com:7050 [2018-09-28 13:41:10.724] [DEBUG] FabricClient - 管理员对等未找到 grpcs://peer0.org1.yx.com:7051 [2018-09-28 13:49:22.980] [DEBUG] 同步 - 启动同步器

我的 config.json 文件是:

{ “网络配置”:{ “开发”:{ “版本”:“1.0”, “客户”:{ “客户”: { “tlsEnable”:是的, “组织”:“Org1MSP”, “频道”:“我的频道”, “凭据存储”:{ "路径": "./tmp/credentialStore_Org1/credential", “加密商店”:{ “路径”:“./tmp/credentialStore_Org1/crypto” } } } }, “渠道”:{ “我的频道”:{ “同行”:{ “peer0.org1.yx.com”:{} }, “联系”: { “暂停”: { “同行”:{ “背书人”:“6000”, "eventHub": "6000", “事件注册”:“6000” } } } } }, “组织”:{ “组织1MSP”:{ "mspid": "Org1MSP", “全路径”:假, “adminPrivateKey”:{ “小路”: “/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/users/Admin@org1.yx.com/msp/keystore” }, “签名证书”:{ “小路”: “/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/users/Admin@org1.yx.com/msp/signcerts” } }, “订购者MSP”:{ "mspid": "OrdererMSP", “adminPrivateKey”:{ “路径”:“/root/blockchain-explorer/examples/dockerConfig/crypto/ordererOrganizations/yx.com/users/Admin@yx.com/msp/keystore” } } }, “同行”:{ “peer0.org1.yx.com”:{ “tlsCACerts”:{ “路径”:“/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/peers/peer0.org1.yx.com/tls/ca.crt” }, "url": "grpcs://peer0.org1.yx.com:7051", "eventUrl": "grpcs://peer0.org1.yx.com:7053", “grpc选项”:{ “ssl 目标名称覆盖”:“peer0.org1.yx.com” } } }, “订购者”:{ “orderer.yx.com”:{ “网址”:“grpcs://orderer.yx.com:7050” } } }, "configtxgenToolPath": "/root/blockchain-explorer/bin", “许可证”:“Apache-2.0” } }

CentOS7 中的hosts文件是

192.168.2.220 orderer.yx.com 192.168.2.221 cli.yx.com 192.168.2.222 peer0.org1.yx.com 192.168.2.223 peer1.org1.yx.com 192.168.2.224 peer0.org2.yx.com

【问题讨论】:

  • 我遇到了类似的错误。以下答案均未解决该问题。如果有修复,请您发布更新

标签: hyperledger-fabric hyperledger-explorer


【解决方案1】:

您可以尝试将 url、eventUrl 的 peers、orderer 更改为 ip 地址,如下所示:

"peer0.org1.yx.com": {
          "tlsCACerts": {
            "path": "/root/blockchain-explorer/examples/dockerConfig/crypto/peerOrganizations/org1.yx.com/peers/peer0.org1.yx.com/tls/ca.crt"
          },
          "url": "grpcs://192.168.2.222:7051",
          "eventUrl": "grpcs://192.168.2.222:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer0.org1.yx.com"
          }
        }

【讨论】:

  • 我们需要在哪个文件中更改上面的更改?
  • 文件 config.json 的资源管理器,上面只更改该配置文件的一部分。
【解决方案2】:

确保 CORE_PEER_GOSSIP_EXTERNALENDPOINT 存在于您的 docker compose 文件中以供同行使用,并且 grpc 和 grpcs 配置正确。

【讨论】:

    猜你喜欢
    • 2017-07-19
    • 1970-01-01
    • 1970-01-01
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-03
    相关资源
    最近更新 更多