2.2 启动test_network遇到的问题及解决方案

一、启动test_network时报的错误

1. C:\Program Files\Docker\Docker\resources\bin\docker.exe: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. 2. See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'. 3. error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json?all=1: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

需要先启动Hyper-V

再启动Docker Desktop,这在重启电脑后容易忘记的两个步骤

二、部署链码时遇到golang.org官网国内不能访问的问题

解决方法:https://zhuanlan.zhihu.com/p/31402004
文中第一个方法手工下载已经试过,还是会报以下错误

google.golang.org/grpc/credentials: google.golang.org/grpc@v1.23.0: Get "https://proxy.golang.org/google.golang.org/grpc/@v/v1.23.0.zip": dial tcp 172.217.160.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

无奈只能试第三个方法,首先要安装glide,但由于glide 本身也有BUG,不适合国内的特殊情况,只能使用作者推荐的库:https://github.com/xkeyideal/glide,先下载

go get github.com/xkeyideal/glide

但使用这个库需要自行编译(make install),安装make install提示

bash: make: command not found

只能先安装GNU make:https://chocolatey.org/packages/make,但按说明直接安装的话还会choco不存在

  1. choco : 无法将“choco”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正
  2. 确,然后再试一次。
  3. 所在位置 行:1 字符: 1
    • choco install make
    •  
    • CategoryInfo : ObjectNotFound: (choco:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

一层套一层的,还是要先安装choco,以管理员身份打开PoserShell,执行以下命令

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::Sec

测试是否安装成功,输入 choco

接着在powershell里安装make并测试是否安装成功

  1. choco install make
  2. make --v

最后把git base关闭再重新启动,进入$GOPATH/src/github.com/xkeyideal/glide 目录,执行

make install

测试是否正常

glide list

不报错说明已经安装成功

接着回到开头说的第三种方法,直接执行还是报错误

  1. $ glide mirror set https://golang.org/x/net/http2 https://github.com/golang/net --base golang.org/x/net --vcs git
  2. [INFO] No mirrors.yaml file exists. Creating new one
  3. [INFO] https://golang.org/x/net/http2 being set to https://github.com/golang/net
  4. [ERROR] Error writing mirrors.yaml file: open C:\Users\Administrator.glide\mirrors.yaml: The system cannot find the path specified.
  5. An Error has occurred

只能继续填坑,按报错信息在C:\Users\Administrator.glide目录下增加mirrors.yaml文件,内容为
注:.glide目录无法直接使用手工创建,只能先在cmd里使用 mkdir .glide 的命令来创建

  1. repos:
  2. repo: https://github.com/golang/crypto
  3. repo: https://github.com/golang/crypto
  4. base: golang.org/x/crypto
  5. repo: https://github.com/golang/sys
  6. base: golang.org/x/sys

然后再测试下:glide mirror list

  1. [INFO] Mirrors...
  2. [INFO] --> https://golang.org/x/crypto replaced by https://github.com/golang/crypto
  3. [INFO] --> https://golang.org/x/crypto/acme/autocert replaced by https://github.com/golang/crypto, base: golang.org/x/crypto
  4. [INFO] --> https://golang.org/x/sys/unix replaced by https://github.com/golang/sys, base: golang.org/x/sys

上面的信息说明配置成功

最后执行

  1. glide mirror set https://golang.org/x/net/http2 https://github.com/golang/net --base golang.org/x/net --vcs git

成功后输出

  1. [INFO] https://golang.org/x/net/http2 being set to https://github.com/golang/net
  2. [INFO] mirrors.yaml written with changes

本文由小韦云原创,转载请注明出处:https://www.bctos.cn/doc/4/1803,否则追究其法律责任

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值