Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...