我正在使用原生kubernetes引擎在google云平台上使用多节点环境进行fabric设置,并提供动态配置(动态pod分配)。
我正在使用helm进行部署。所以让我告诉你成功运行的实体。
1-> 1个pod名称为ord1-hlf-ord-54bbffd6f7-4qtxd的订单者
2-> 1个pod名称为cdb-peer1-hlf-couchdb-7cf88678b8-74426的couchdb
3-> 1个pod名称为peer1-hlf-peer-6c5f6886d4-wrddj的对等体
到现在为止,一切都很好。让我粘贴下面一些有用命令的结果
kubectl get nodes
master Ready master 138m v1.14.1
worker1 Ready <none> 135m v1.14.1kubectl get ns
default Active 141m
kube-node-lease Active 141m
kube-public Active 141m
kube-system Active 141m
orderers Active 122m
peers Active 122mkubectl 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 120mkubectl 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进入对等pod并尝试运行apt-get update时,这样通过安装ping我就可以检查对等pod是否能够ping orderer,然后我就会收到错误
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.如果任何人遇到这个问题,有关于问题的原因的知识,请让我知道。
提前感谢
发布于 2019-05-08 15:12:14
如果它在应用orderer IP地址时工作。然后可能尝试在您的/etc/hosts文件中输入一个条目。该条目将如下所示
10.105.9.161 ord1-hlf-ord.orderers.svc.cluster.local这应该允许您解析DNS,您可以通过pinging ord1-hlf-ord.orderers.svc.cluster.local进行检查。
https://stackoverflow.com/questions/55949232
复制相似问题