Kubernetes Hyperledger Fabric Orderer-无法创建新连接

时间:2019-02-18 07:24:18

标签: kubernetes hyperledger-fabric hyperledger

我正在尝试使用kubernetes(1个Master和1个Minion)Wavenet网络配置来设置Hyperledger结构。

Kubernetes版本:1.13.3 Ubuntu版本:18.04(仿生)

以下是我为订购者提供的部署和服务。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: orderer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: orderer
  template:
    metadata:
      labels:
        app: orderer
    spec:
      hostname: orderer-example-com
      volumes:
      - name: nfs-volume
        nfs: 
         server: 13.71.xx.xx 
         path: /home/         
      containers:
      - args:
        - orderer
        env:
            - name: ORDERER_GENERAL_GENESISFILE
              value: /home/channel/genesis.block
            - name: ORDERER_GENERAL_GENESISMETHOD
              value: file
            - name: ORDERER_GENERAL_LEDGERTYPE
              value: json
            - name: ORDERER_GENERAL_LISTENADDRESS
              value: 127.0.0.1
            - name: ORDERER_GENERAL_LISTENPORT
              value: "7050"
            - name: ORDERER_GENERAL_LOCALMSPDIR
              value: "/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/msp"
            - name: ORDERER_GENERAL_LOCALMSPID
              value: OrdererMSP
            - name: ORDERER_GENERAL_LOGLEVEL
              value: info
            - name: ORDERER_GENERAL_TLS_CERTIFICATE
              value: /home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/server.crt
            - name: ORDERER_GENERAL_TLS_ENABLED
              value: "false"
            - name: ORDERER_GENERAL_TLS_PRIVATEKEY
              value: /home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/server.key
            - name: ORDERER_GENERAL_TLS_ROOTCAS
              value: '[/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com/tls/ca.crt]'
        image: hyperledger/fabric-orderer
        name: orderer
        ports:
         - name: orderer-port
           containerPort: 7050
        resources: {}
        volumeMounts:
              - mountPath: "/home/"
                name: nfs-volume
            # - mountPath: "/home/channel"
            #   name: orderer-insurance-com-claim0
            # - mountPath: "/home/crypto/crypto-config/ordererOrganizations/insurance.com/orderers/orderer.insurance.com"
            #   name: orderer-insurance-com-claim1        
        workingDir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
      restartPolicy: Always    

 -----
 apiVersion: v1
kind: Service
metadata:
  name: orderer
spec:
  selector:
    app: orderer
  ports:
   - protocol: TCP
     targetPort: 7050
     port: 7050
     nodePort: 31001
     name: orderer-port
  type: NodePort

我已将订购者部署的端口7050作为服务公开到端口31001。订购者容器似乎运行良好,并且容器或服务中没有错误。奇怪的是,当我尝试连接订购服务时,它总是超时

我确实检查了服务,并且确实暴露了端口,即7050-> 310001。不知道为什么我会超时。

  

卷曲“ localhost:31001”也超时。

如果我缺少kubernetes,可以让我知道吗?

**更新:订购者舱描述

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

我不认为

- name: ORDERER_GENERAL_LISTENADDRESS
  value: 127.0.0.1 

将起作用,因为这意味着订购者仅侦听容器内的环回地址。尝试将值设置为0.0.0.0