无法与对等超级账本结构的订购者进行通信

时间:2019-05-02 09:17:35

标签: kubernetes google-cloud-platform hyperledger-fabric hyperledger kubernetes-helm

我正在使用本机kubernetes引擎在Google云平台上使用具有动态配置(动态Pod分配)的多节点环境进行结构的设置。

我正在使用头盔进行部署。因此,让我告诉您正在成功运行的实体。

1-> 1个具有pod名称ord1-hlf-ord-54bbffd6f7-4qtxd的订购者

2-> 1个Poddb,其Pod名称为cdb-peer1-hlf-couchdb-7cf88678b8-74426

3-> 1个具有Pod名称peer1-hlf-peer-6c5f6886d4-wrddj的同位体

到目前为止,一切都很好。让我将一些有用命令的结果粘贴到

之下

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

现在您可以看到订购者正在以服务名ord1-hlf-ord运行,因此我正在按照kubernetes模式将其连接为service-name.namespace.svc.cluster.local,因此我尝试在ord1-hlf-ord.orderers.svc.cluster.local:7050上连接订购者下面的命令:

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" 

但是我无法连接到订购者

我想告诉你的另一件事是,当我使用命令kubectl exec -it peer1-hlf-peer-6c5f6886d4-wrddj bash -n peers进入对等节点并尝试运行apt-get update时,通过安装ping可以检查对等节点是否能够ping订购者与否,然后出现错误

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.

如果有人面对这个问题的原因,那么请告诉我。

预先感谢

1 个答案:

答案 0 :(得分:1)

如果在应用daml IP地址时可以正常工作。然后,可能尝试在orderer文件中为其输入一个条目。该条目将类似于

/etc/hosts

这应该允许您解析DNS,可以通过ping 10.105.9.161 ord1-hlf-ord.orderers.svc.cluster.local

进行检查。