Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

docker - Hyperledger-fabric blockchain Multi Host

I am working on hyperledger fabric and I would like to have some guidance in using hyperledger fabric with multiple hosts. I have an orderer, a ca, two peers (Peer 0 and Peer 1) and two hosts (10.10.10.x and 10.10.11.x). I have the orderer, ca and Peer0 in host - 1 and Peer1 in a separate host (i.e) Peer 0 in host-1 and Peer 1 alone on host-2.

I need to connect Peer1 in host 2 to Peer0 in host 1. I can achieve this scenario while having multiple hosts in the same network using docker swarm and overlay network (i.e) hosts are in same IP range (10.10.10.x), but while trying to do this in a host in a different network (10.10.11.X) I am unable to connect the peer to the host present in Machine-1. I had done the multihost network by referring this link.

Docker Version used:
[root@node2 composer]# docker -v
Docker version 18.03.1-ce, build 9ee9f40
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Add extra_host entry in docker-compose.yml file like this:

extra_hosts:
      - "peer0.org2.example.com:192.168.1.28" 
      - "ca.org2.example.com:192.168.1.28"   
      - "peer0.org3.example.com:192.168.1.15"
      - "ca.org3.example.com:192.168.1.15"

Like this do entries for all orderers, CA, peers on both machines(hosts)

And do same host entry in host file: sudo nano /etc/hosts - edit this file

192.168.1.28     peer0.org2.example.com
192.168.1.28     ca.org2.example.com
192.168.1.15     peer0.org3.example.com
192.168.1.15     ca.org3.example.com

Like this do entries for all orderers, CA, peers...on both machines(hosts)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...