fabric多机部署时,端口映射问题

版权声明:本文为原创文章,未经允许不得转载 https://blog.csdn.net/qq_33875256/article/details/86685800

多机部署时遇到这个错误:

grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 10.26.40.125:7051: getsockopt: connection refused"; Reconnecting to {peer1.org1.example.com:7051 <nil>}

可能是端口映射出了问题。

问题出在

配置文件中

cli 的地址为CORE_PEER_ADDRESS=peer1.org1.example.com:7051

即:cli(客户端)访问时访问主机的7051端口

然而

base/docker-compose-base.yaml 中peer节点映射为8051:7051  ,此时此机器上peer节点的映射关系为主机8051端口->(映射)docker容器的7051端口。

所以,当cli客户端访问容器时7051端口未映射到docker容器,访问出错。

猜你喜欢

转载自blog.csdn.net/qq_33875256/article/details/86685800