You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

借助Hyperledger Cello部署多主机Fabric环境遇错求助

解决Hyperledger Cello部署中Golang二进制包URL被识别为本地路径的问题

看起来你遇到的核心问题是Ansible任务错误地将Golang的下载URL解析成了本地文件路径,导致无法找到对应资源。我们一步步来排查和解决:

问题诊断

从报错信息里能发现关键线索:

ERROR! file or module does not exist: /home/rtcin/go/src/github.com/hyperledger/hyperchain/cello/src/agent/ansible/roles/env_flanneld/https:/storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz

注意到URL部分是https:/(单斜杠)而非正确的https://(双斜杠),这直接导致Ansible把这个URL当成了角色目录下的相对路径去查找,而不是发起HTTP请求下载远程文件。

解决方案步骤

1. 修正Ansible任务中的Golang下载URL

打开报错指向的任务文件:/home/rtcin/go/src/github.com/hyperledger/hyperchain/cello/src/agent/ansible/roles/env_flanneld/fastinitnode/tasks/apply.yml,定位到第48行的Retrive golang binary and unpackage it任务。

确保任务使用get_url模块(用于从远程URL下载文件),并且URL是完整的双斜杠格式:

- name: Retrive golang binary and unpackage it
  get_url:
    url: https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
    dest: "{{ ansible_env.HOME }}/.ansible/tmp/ansible-tmp-{{ ansible_date_time.epoch }}-xxxx/source"
    mode: 0644
  become: no

如果之前任务误用了copy模块(用于本地文件复制),请替换为get_url模块。

2. 检查变量配置(若使用变量存储URL)

如果任务中通过变量引用Golang下载地址(比如{{ golang_download_url }}),请确认对应的变量文件(如group_vars或host_vars下的配置)里,变量值是完整的https://开头的URL,没有拼写错误。

3. 重新执行Ansible Playbook

修正后,重新运行部署命令:

ansible-playbook -vvv -i run/runhosts -e "mode=apply env=azure env_type=flanneld ansible_ssh_user=hyperchain" initcluster.yml

可以先加上--check参数进行模拟执行,确认任务逻辑正确后再正式运行:

ansible-playbook --check -vvv -i run/runhosts -e "mode=apply env=azure env_type=flanneld ansible_ssh_user=hyperchain" initcluster.yml

4. 备选方案:手动下载后上传(网络受限场景)

如果控制节点无法访问Google Storage,可先手动下载Golang包到本地:

wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -P /tmp/

然后修改Ansible任务为copy模块,从本地路径上传:

- name: Copy golang binary to remote node
  copy:
    src: /tmp/go1.8.3.linux-amd64.tar.gz
    dest: /home/hyperchain/go1.8.3.linux-amd64.tar.gz
    mode: 0644

内容的提问来源于stack exchange,提问作者Darshu Bc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:02:16