美文网首页
Fabric-Failed to connect to goo.

Fabric-Failed to connect to goo.

作者: tolak | 来源:发表于2017-09-07 16:03 被阅读1232次

    在搭建Fabric 1.0 开发环境时官方文档:http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#binaries 介绍使用如下命令下载Fabric平台相关的可执行文件和docker镜像:

    curl -sSL https://goo.gl/Gci9ZX | bash
    

    但是基本上都会遇到下面的错误:

    curl: (7) Failed to connect to goo.gl port 443: Connection timed out
    

    这个问题google了也未必能解决,网上的说法一大堆,有的说是ipv6导致,有的说是防火墙导致。。。

    如果是Fabric,我这里推荐一种做法,无意间发现的,没想到竟然有效果:

    step1

    在浏览器中打开命令curl -sSL https://goo.gl/Gci9ZX | bash中的这个链接https://goo.gl/Gci9ZX(需要翻墙),然后你可以看到这其实就是一个shell脚本,内容如下:

    #!/bin/bash
    #
    # Copyright IBM Corp. All Rights Reserved.
    #
    # SPDX-License-Identifier: Apache-2.0
    #
    
    export VERSION=1.0.2
    export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
    #Set MARCH variable i.e ppc64le,s390x,x86_64,i386
    MARCH=`uname -m`
    
    dockerFabricPull() {
      local FABRIC_TAG=$1
      for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do
          echo "==> FABRIC IMAGE: $IMAGES"
          echo
          docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
          docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
      done
    }
    
    dockerCaPull() {
          local CA_TAG=$1
          echo "==> FABRIC CA IMAGE"
          echo
          docker pull hyperledger/fabric-ca:$CA_TAG
          docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
    }
    
    : ${CA_TAG:="$MARCH-$VERSION"}
    : ${FABRIC_TAG:="$MARCH-$VERSION"}
    
    echo "===> Downloading platform binaries"
    curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz
    
    echo "===> Pulling fabric Images"
    dockerFabricPull ${FABRIC_TAG}
    
    echo "===> Pulling fabric ca Image"
    dockerCaPull ${CA_TAG}
    echo
    echo "===> List out hyperledger docker images"
    docker images | grep hyperledger*
    

    脚本也就主要做了两件事:下载平台相关可执行文件和下载fabric docker镜像。

    step2

    在你的本地目录新建download.sh(名字随便起),将网页上的内容复制到文件里,然后保存退出执行以下命令:

    chmod a+x download.sh
    

    然后执行命令:

    ./download.sh
    

    你可以看到已经开始下载了!

    PS:这里第一阶段下载平台相关执行文件可以翻墙要快一些,然后当开始下载docker镜像时关掉代理。为了使docker下载快一点,记得配置docker加速器!


    版权所有,转载请注明出处。

    相关文章

      网友评论

          本文标题:Fabric-Failed to connect to goo.

          本文链接:https://www.haomeiwen.com/subject/eouijxtx.html