Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to communicate with orderer from peer hyperledger fabric

I am doing a setup of fabric using multinode environment with dynamic provision (dynamic pod allocation) over google cloud platform using native kubernetes engine.

I am using helm for the deployment . So let me tell you the entity which are running successfully .

1-> 1 Orderer with pod name ord1-hlf-ord-54bbffd6f7-4qtxd

2-> 1 couchdb with pod name cdb-peer1-hlf-couchdb-7cf88678b8-74426

3-> 1 peer with pod name peer1-hlf-peer-6c5f6886d4-wrddj

Till now everything is fine . Let me paste the results of some useful commands below

kubectl get nodes

master    Ready    master   138m   v1.14.1
worker1   Ready    <none>   135m   v1.14.1

kubectl get ns

default           Active   141m
kube-node-lease   Active   141m
kube-public       Active   141m
kube-system       Active   141m
orderers          Active   122m
peers             Active   122m

kubectl get pods -n peers

cdb-peer1-hlf-couchdb-7cf88678b8-74426   1/1     Running   0          114m
peer1-hlf-peer-6c5f6886d4-wrddj          1/1     Running   0          33m     

kubectl get pods -n orderers

NAME                            READY   STATUS    RESTARTS   AGE
ord1-hlf-ord-54bbffd6f7-4qtxd   1/1     Running   0          120m

kubectl get svc -A

NAMESPACE     NAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes              ClusterIP   10.96.0.1        <none>        443/TCP                  144m
kube-system   kube-dns                ClusterIP   10.96.0.10       <none>        53/UDP,53/TCP,9153/TCP   144m
kube-system   tiller-deploy           ClusterIP   10.111.43.221    <none>        44134/TCP                138m
orderers      ord1-hlf-ord            ClusterIP   10.105.9.161     <none>        7050/TCP                 121m
peers         cdb-peer1-hlf-couchdb   ClusterIP   10.99.87.182     <none>        5984/TCP                 117m
peers         peer1-hlf-peer          ClusterIP   10.110.219.142   <none>        7051/TCP,7053/TCP        35m

now as you can see that orderer is running with service name ord1-hlf-ord so I am following the kubernetes pattern to connect this as service-name.namespace.svc.cluster.local so I am trying to connect orderer on ord1-hlf-ord.orderers.svc.cluster.local:7050 In the below command :

kubectl exec -n peers $PEER_POD -- su -c "CORE_PEER_MSPCONFIGPATH=/var/hyperledger/admin_msp peer channel create -o ord1-hlf-ord.orderers.svc.cluster.local:7050 -c mychannel -f /hl_config/channel/channel.tx" 

But I am not able to connect to orderer

One more thing I want to tell you that when I am entering into the peer pod using command kubectl exec -it peer1-hlf-peer-6c5f6886d4-wrddj bash -n peers and trying to run apt-get update , So that by installing ping I can check that peer is able to ping orderer or not then I am getting error

root@peer1-hlf-peer-6c5f6886d4-wrddj:/# apt-get update
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease        
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease                  
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done        
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

If anyone faced this issue of having knowledge about the cause of issue then please let me know.

Thanks in advance

like image 299
Pankaj Cheema Avatar asked May 02 '19 09:05

Pankaj Cheema


1 Answers

If it is working while applying the orderer IP address. Then probably try entering an entry for it in your /etc/hosts file. The entry will look like

    10.105.9.161 ord1-hlf-ord.orderers.svc.cluster.local

This should allow you to resolve DNS, you can check this by pinging ord1-hlf-ord.orderers.svc.cluster.local

like image 198
ViKiG Avatar answered Oct 21 '22 18:10

ViKiG