首页 > 解决方案 > Hyperledger 资源管理器始终显示为 3 个虚拟机上结构网络的 1 个节点,对等状态显示为关闭

问题描述

我在 3 个虚拟机中运行 Hyperledger 结构网络,并且正在使用 Docker Swarm 完成集群管理。一台虚拟机包含 Orderer、CLI 和 Hyperledger explorer 设置,而另外两台机器配置了 4 个组织,每个组织具有 1 个 CA、2 个对等点和 1 个 CouchDB 实例。

Hyperledger 浏览器始终显示节点计数为 1,并且对等点状态始终处于关闭状态。交易在放置时会得到适当的传播,并且也会反映在图表中。

标签: hyperledger-fabrichyperledgerhyperledger-explorer

解决方案


当 blockchain-explorer-container 无法访问/ping 节点时,节点显示为关闭。您可以使用docker exec -ti blockchain-explorer ping peer1.org1.example.com. 替换peer1.org1.example.com为您在 config.json 文件中编写的对等地址。如果结果类似于ping: bad address "peer1.org1.example.com",则容器无法 ping 它。你现在有两种可能。您可以在 config.json 文件中将 peer-address 更改为 ip-address:

"url": "grpcs://ip-address:7051",
"eventUrl": "grpcs://ip-address:7053"

或者您可以在 docker run 命令中添加主机。如果您使用 deploy-explorer.sh 启动资源管理器,它位于方法 deploy_run_explorer() 中:

docker run \
        -d \
        --name $fabric_explorer_name \
        --net $docker_network_name --ip $explorer_ip \
        -e DATABASE_HOST=$db_ip \
        -e DATABASE_USERNAME=$explorer_db_user \
        -e DATABASE_PASSWD=$explorer_db_pwd \
        -v $network_config_file:/opt/explorer/app/platform/fabric/config.json \
        -v $network_crypto_base_path:/tmp/crypto \
        -p 8090:8080 \
        --add-host=peer1.org1.example.com:ip-address \           <-- New line
        --add-host=peer2.org2.example.com:ip-address \           <-- New line
        $fabric_explorer_tag

推荐阅读