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

Windows环境下Hyperledger Test Network启动卡住求助

问题描述

在Windows环境下已配置Docker镜像,执行./network.sh up启动Hyperledger Test Network时卡住,卡在创建peer组织阶段。已执行./network.sh down清理旧网络,解决了Docker未运行的错误,但启动仍失败。使用镜像为hyperledger/fabric-peer:latest,启动日志如下:

Using docker and docker-compose
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds 
and using database 'leveldb'
LOCAL_VERSION=v2.5.0
DOCKER_IMAGE_VERSION=v2.5.0
Network fabric_test  Creating
Network fabric_test  Created
Volume "compose_peer0.org2.example.com"  Creating
Volume "compose_peer0.org2.example.com"  Created
Volume "compose_orderer.example.com"  Creating
Volume "compose_orderer.example.com"  Created
Volume "compose_peer0.org1.example.com"  Creating
Volume "compose_peer0.org1.example.com"  Created
Container peer0.org2.example.com  Creating
Container peer0.org1.example.com  Creating
Container orderer.example.com  Creating
排查与解决步骤
  • 查看容器实时日志定位错误
    新开终端,执行以下命令分别查看卡住容器的日志,明确具体故障原因:

    docker logs -f peer0.org1.example.com
    docker logs -f peer0.org2.example.com
    docker logs -f orderer.example.com
    

    常见问题包括端口被占用、文件权限异常、镜像版本不兼容等。

  • 检查并释放占用端口
    打开Windows命令提示符,执行netstat -ano | findstr "7050 7051 9051"(Test Network默认端口),若有结果,通过任务管理器结束对应PID的进程,再重新启动网络。

  • 彻底清理Docker残留资源
    执行./network.sh down后,手动清理可能残留的容器、网络和卷:

    docker rm -f $(docker ps -aq)
    docker network prune -f
    docker volume prune -f
    

    清理完成后重新运行./network.sh up。

  • 统一镜像与本地版本
    当前本地版本为v2.5.0,但使用的是latest镜像,易出现版本不兼容。拉取对应版本的镜像:

    docker pull hyperledger/fabric-peer:v2.5.0
    docker pull hyperledger/fabric-orderer:v2.5.0
    

    确保启动脚本使用匹配的镜像版本后重试。

  • 调整WSL2资源配置(若使用WSL2后端)
    若Docker采用WSL2后端,在用户目录下新建或编辑.wslconfig文件,添加资源限制:

    [wsl2]
    memory=4GB
    processors=2
    

    执行wsl --shutdown重启WSL后,重新启动Docker和Test Network。

  • 临时关闭防火墙验证
    关闭Windows Defender防火墙后尝试启动网络,若成功则为Docker容器添加入站/出站规则,允许相关端口通信。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.19 06:00:02