繁体   English   中英

Orderer的Hyperledger Fabric Peer连接错误

[英]Hyperledger Fabric Peer Connection error with Orderer

我正在尝试将对等方连接到本地计算机中的订货人。 这是我到目前为止所做的。

我在启动Fabric CA Server后启动了Orderer

export ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
export ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
export ORDERER_GENERAL_LOCALMSPID=OrdererMSP
export ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
export ORDERER_GENERAL_LISTENADDRESS=192.168.2.103
export ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
export ORDERER_GENERAL_LOGLEVEL=debug
export ORDERER_GENERAL_GENESISMETHOD=file
export ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
export FABRIC_CFG_PATH=/etc/hyperledger/fabric
export ORDERER_GENERAL_TLS_ENABLED=true
orderer

然后我尝试使用此命令启动结构对等体。

 export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
 export CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
 export CORE_PEER_GOSSIP_ORGLEADER=false
 export CORE_PEER_PROFILE_ENABLED=true
 export CORE_PEER_LOCALMSPID=Org1MSP
 export CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
 export CORE_PEER_TLS_ENABLED=true
 export CORE_PEER_ID=peer0.org1.example.com
 export CORE_LOGGING_LEVEL=DEBUG
 export CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
 export FABRIC_CFG_PATH=/etc/hyperledger/fabric
 export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
 export CORE_PEER_GOSSIP_USELEADERELECTION=true

在我运行命令peer node start之后,我已经将必要的文件复制到所需的目录作为experter,这个命令给了我错误

2017-12-26 18:22:47.613 IST [deliveryClient] connect - > DEBU 32e已连接到2017-12-26 18:22:47.613 IST [deliveryClient] connect - > ERRO 32f无法获取连接:无法连接到任何端点:[orderer.example.com:7050] 2017-12-26 18:22:47.614 IST [deliveryClient]试试 - > WARN 330得到错误:无法连接到任何端点:[orderer.example.com: 7050],8次尝试。 在2分8秒内重试

在订货方,我得到了这个

2017-12-26 18:24:55.617 IST [grpc] Printf - > DEBU 191 grpc:Server.Serve无法完成“192.168.2.103:56580”的安全握手:EOF

谁能告诉我这里做错了什么?

谢谢

我认为您的情况下的问题是您正在尝试使用为fabric-sample生成的配置事务,它将订购服务端点编码为orderer.example.com:7050同时运行本地计算机时此地址无法访问。 因此,作为一个简单的解决方案,您可以扩展/etc/hosts文件并使orderer.example.com域名指向您的localhost。 第二个选项是在配置事务中更改订购服务端点,例如configtx.yaml

################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults

    # Orderer Type: The orderer implementation to start
    # Available types are "solo" and "kafka"
    OrdererType: solo

    Addresses:
        - localhost:7050

    # Batch Timeout: The amount of time to wait before creating a batch
    BatchTimeout: 2s

    # Batch Size: Controls the number of messages batched into a block
    BatchSize:

        # Max Message Count: The maximum number of messages to permit in a batch
        MaxMessageCount: 10

        # Absolute Max Bytes: The absolute maximum number of bytes allowed for
        # the serialized messages in a batch.
        AbsoluteMaxBytes: 98 MB

        # Preferred Max Bytes: The preferred maximum number of bytes allowed for
        # the serialized messages in a batch. A message larger than the preferred
        # max bytes will result in a batch larger than preferred max bytes.
        PreferredMaxBytes: 512 KB

    Kafka:
        # Brokers: A list of Kafka brokers to which the orderer connects
        # NOTE: Use IP:port notation
        Brokers:
            - 127.0.0.1:9092

    # Organizations is the list of orgs which are defined as participants on
    # the orderer side of the network
    Organizations:

基本上你需要更改以下行:

    Addresses:
        - PUT_HERE_CORRECT_IP_ADDRESS:7050

接下来,您需要运行configtxgen工具来获取更新的配置事务块。

每当我认为这是不正确的证书。 上次我花了半天的时间才发现我已经将peer1.org1证书复制到了订购者的peer1.org2文件夹中。 (对我来说,org2是一个不同的CA服务器)。 一旦我在用于创建通道块的configtx.yaml中有1个错误的MSPDir路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM