Fabric e2e_cli: Ordering Service is not available, Please try again …

Fabric e2e_cli: Ordering Service is not available, Please try again …

1,安装基础环境与部署Fabric系统步骤

  1. 安装Docker CE
  2. 安装Docker-Compose
  3. 安装与配置go语言环境
  4. 下载Fabric源码并编译
  5. 下载Fabric相关Docker镜像

2, 运行e2e_cli示例

  • 运行e2e_cli步骤:
    a.基础环境安装并运行e2e_cli环境时,切换到示例目录中,如下所示。
    cd /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/
    b.运行e2e_cli中的network_setup.sh脚本
    bash network_setup.sh up

运行成功后如图所示。Fabric e2e_cli: Ordering Service is not available, Please try again …_第1张图片
Fabric e2e_cli: Ordering Service is not available, Please try again …_第2张图片

3, 遇到的问题及解决办法

问题1:在阿里云上部署Fabric,遇到如下问题

Attempting to fetch system channel 'testchainid' ...51 secs
2020-05-04 07:02:43.716 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-05-04 07:02:43.716 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-05-04 07:02:43.720 UTC [grpc] Printf -> DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup orderer.example.com: no such host"; Reconnecting to {orderer.example.com:7050 <nil>}
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f18fbdf1259
......
......
internal/singleflight.(*Group).doCall(0x169d360, 0xc420323a90, 0x7ffe719e1a8a, 0x13, 0xc4203ddf80)
        /opt/go/src/internal/singleflight/singleflight.go:93 +0x2e
created by internal/singleflight.(*Group).DoChan
        /opt/go/src/internal/singleflight/singleflight.go:86 +0x31f
!!!!!!!!!!!!!!! Ordering Service is not available, Please try again ... !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================

解决办法一:
修改 /etc/resolv.conf 配置,如下所示。
在这里插入图片描述
原因分析参见【 阿里云环境部署Hyperledger Fabric之SIGSEGV 问题分析解解决经验分享 https://yq.aliyun.com/articles/238940 】

解决办法二:
在docker-compose-cli.yml,docker-compose-base.yaml, peer-base.yaml中cli增加

  • GODEBUG=netdns=go
    在每个关键字段environment:下面都加入该条配置。
    Fabric e2e_cli: Ordering Service is not available, Please try again …_第3张图片

问题2:运行启动脚本,出现"network e2ecli_default not found"错误提示

2020-05-06 08:38:39.417 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0ABF070A6708031A0C088FEFC9F50510...535010030A04657363630A0476736363
2020-05-06 08:38:39.417 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 40A02BA733266C435560C28FF612C81A506F7705A9985FF79D04C5809D3D50DE
Error: Error endorsing chaincode: rpc error: code = Unknown desc = error starting container: API error (404): {"message":"network e2ecli_default not found"}

解决办法:目录切换到e2e_cli目录,运行下列命令
vim ./base/peer-base.yaml
修改peer-base.yaml中的
-CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2ecli_default 为
-CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default

你可能感兴趣的:(区块链,linux,区块链,ubuntu,docker,golang)