在kafka日志过期后,如何使用kafka OSN在Fabric上还原业务网络

时间:2019-05-31 12:25:49

标签: apache-kafka hyperledger-fabric

我们使用docker swarm创建了一个以kafka为(OSN)的hyperleder fabric网络,但是我们没有将kafka挂载到卷上,只挂载了订购者和同伴。 现在托管docker swarm的虚拟机已重新设置,并且在订购者节点上出现此错误:

“由于进程失败= kafka服务器,需要重试:请求的偏移量超出了服务器为给定主题/分区维护的偏移量范围”

我们通过同时安装kafak和zookeeper的卷并禁用kafka保留来解决新环境下的问题(KAFKA_LOG_RETENTION_MS:'-1') 但是,该解决方案需要一个干净的环境,并且不能在旧环境下使用。 问题是如何从kafka日志已过期的旧网络中恢复数据

================================================ ====

修改前的docker-compose.yml文件:

    networks:
    sample:
        attachable: true
        driver: overlay
    services:
    ca_peerOrga:
        command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca_peerOrga-cert.pem
        --ca.keyfile /etc/hyperledger/fabric-ca-server-config/key_sk -b admin:PwD4AdminCA
        -d'
        environment:
        FABRIC_CA_HOME: /etc/hyperledger/fabric-ca-server
        FABRIC_CA_SERVER_CA_NAME: ca_peerOrga
        FABRIC_CA_SERVER_TLS_CERTFILE: /etc/hyperledger/fabric-ca-server-config/ca_peerOrga-cert.pem
        FABRIC_CA_SERVER_TLS_ENABLED: "True"
        FABRIC_CA_SERVER_TLS_KEYFILE: /etc/hyperledger/fabric-ca-server-config/key_sk
        'TZ: UTC': null
        image: hyperledger/fabric-ca:1.4.0
        networks:
        sample: null
        ports:
        - 7054:7054/tcp
        volumes:
        - ./crypto-config/peerOrganizations/orga_mycompany_com/ca:/etc/hyperledger/fabric-ca-server-config:rw
    cli:
        deploy:
        restart_policy:
            condition: none
            delay: 60s
        command: /bin/bash -c './scripts/init.sh;'
        depends_on:
        - ca_peerOrga
        - orderer_mycompany_com
        - peer0_orga_mycompany_com
        environment:
        CORE_PEER_ADDRESS: peer0_orga_mycompany_com:7051
        CORE_PEER_ID: cli
        CORE_PEER_LOCALMSPID: OrgaMSP
        CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/users/Admin@orga_mycompany_com/msp
        CORE_PEER_TLS_CERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/server.crt
        CORE_PEER_TLS_ENABLED: "True"
        CORE_PEER_TLS_KEY_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/server.key
        CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/ca.crt
        CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
        FABRIC_LOGGING_SPEC: DEBUG
        GOPATH: /opt/gopath
        'TZ: UTC': null
        hostname: fabric-cli
        image: hyperledger/fabric-tools:1.4.0
        links:
        - orderer_mycompany_com
        - peer0_orga_mycompany_com
        - ca_peerOrga
        networks:
        sample: null
        ports:
        - 5050:5050/tcp
        stdin_open: true
        tty: true
        volumes:
        - /var/run:/host/var/run:rw
        - ./chaincode:/opt/gopath/src/github.com/hyperledger/fabric/chaincode:rw
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto:rw
        - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts:rw
        - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    couchdb0:
        environment:
        COUCHDB_PASSWORD: couchdb_pwd0
        COUCHDB_USER: couchdb_user0
        image: hyperledger/fabric-couchdb:0.4.15
        networks:
        sample: null
        ports:
        - 5984:5984/tcp
    kafka0-mycompany-com:
        container_name: kafka0-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '0'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 9092:9092/tcp
        - 9093:9093/tcp
        restart: always
    kafka1-mycompany-com:
        container_name: kafka1-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '1'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 10092:9092/tcp
        - 10093:9093/tcp
        restart: always
    kafka2-mycompany-com:
        container_name: kafka2-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '2'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 11092:9092/tcp
        - 11093:9093/tcp
        restart: always
    kafka3-mycompany-com:
        container_name: kafka3-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '3'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 12092:9092/tcp
        - 12093:9093/tcp
        restart: always
    orderer_mycompany_com:
        command: orderer
        environment:
        CONFIGTX_ORDERER_KAFKA_BROKERS: kafka0-mycompany-com:9092,kafka1-mycompany-com:9092,kafka2-mycompany-com:9092,kafka3-mycompany-com:9092
        CONFIGTX_ORDERER_ORDERERTYPE: kafka
        FABRIC_LOGGING_SPEC: debug
        ORDERER_GENERAL_GENESISFILE: /var/hyperledger/orderer/orderer.genesis.block
        ORDERER_GENERAL_GENESISMETHOD: file
        ORDERER_GENERAL_LISTENADDRESS: 0.0.0.0
        ORDERER_GENERAL_LOCALMSPDIR: /var/hyperledger/orderer/msp
        ORDERER_GENERAL_LOCALMSPID: OrdererMSP
        ORDERER_GENERAL_TLS_CERTIFICATE: /var/hyperledger/orderer/tls/server.crt
        ORDERER_GENERAL_TLS_ENABLED: "True"
        ORDERER_GENERAL_TLS_PRIVATEKEY: /var/hyperledger/orderer/tls/server.key
        ORDERER_GENERAL_TLS_ROOTCAS: '[/var/hyperledger/orderer/tls/ca.crt]'
        ORDERER_KAFKA_RETRY_SHORTINTERVAL: 1s
        ORDERER_KAFKA_RETRY_SHORTTOTAL: 100s
        ORDERER_KAFKA_VERBOSE: "true"
        'TZ: UTC': null
        image: hyperledger/fabric-orderer:1.4.0
        networks:
        sample: null
        ports:
        - 7050:7050/tcp
        volumes:
        - ./crypto-config/ordererOrganizations/mycompany_com/orderers/orderer_mycompany_com/msp:/var/hyperledger/orderer/msp:rw
        - ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block:rw
        - ./crypto-config/ordererOrganizations/mycompany_com/orderers/orderer_mycompany_com/tls:/var/hyperledger/orderer/tls:rw
        - orderer_mycompany_com:/var/hyperledger/production/orderer:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    peer0_orga_mycompany_com:
        command: sh -c "peer node start"
        depends_on:
        - couchdb0
        environment:
        CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: couchdb0:5984
        CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD: couchdb_pwd0
        CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME: couchdb_user0
        CORE_LEDGER_STATE_STATEDATABASE: CouchDB
        CORE_LOGGING_LEVEL: DEBUG
        CORE_PEER_ADDRESS: peer0_orga_mycompany_com:7051
        CORE_PEER_CHAINCODELISTENADDRESS: 0.0.0.0:7052
        CORE_PEER_GOSSIP_EXTERNALENDPOINT: peer0_orga_mycompany_com:7051
        CORE_PEER_GOSSIP_ORGLEADER: "false"
        CORE_PEER_GOSSIP_USELEADERELECTION: "true"
        CORE_PEER_ID: peer0_orga_mycompany_com
        CORE_PEER_LOCALMSPID: OrgaMSP
        CORE_PEER_PROFILE_ENABLED: "true"
        CORE_PEER_TLS_CERT_FILE: /etc/hyperledger/fabric/tls/server.crt
        CORE_PEER_TLS_ENABLED: "True"
        CORE_PEER_TLS_KEY_FILE: /etc/hyperledger/fabric/tls/server.key
        CORE_PEER_TLS_ROOTCERT_FILE: /etc/hyperledger/fabric/tls/ca.crt
        CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE: project1_sample
        CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
        'TZ: UTC': null
        image: hyperledger/fabric-peer:1.4.0
        networks:
        sample: null
        ports:
        - 7051:7051/tcp
        - 7053:7053/tcp
        volumes:
        - ./crypto-config/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/msp:/etc/hyperledger/fabric/msp:rw
        - ./crypto-config/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls:/etc/hyperledger/fabric/tls:rw
        - /var/run:/host/var/run:rw
        - peer0_orga_mycompany_com:/var/hyperledger/production:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    zookeeper0-mycompany-com:
        container_name: zookeeper0-mycompany-com
        environment:
        ZOO_MY_ID: '1'
        ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zookeeper1-mycompany-com:2888:3888
            server.3=zookeeper2-mycompany-com:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 2181:2181/tcp
        - 2888:2888/tcp
        - 3888:3888/tcp
        restart: always
    zookeeper1-mycompany-com:
        container_name: zookeeper1-mycompany-com
        environment:
        ZOO_MY_ID: '2'
        ZOO_SERVERS: server.1=zookeeper0-mycompany-com:2888:3888 server.2=0.0.0.0:2888:3888
            server.3=zookeeper2-mycompany-com:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 12181:2181/tcp
        - 12888:2888/tcp
        - 13888:3888/tcp
        restart: always
    zookeeper2-mycompany-com:
        container_name: zookeeper2-mycompany-com
        environment:
        ZOO_MY_ID: '3'
        ZOO_SERVERS: server.1=zookeeper0-mycompany-com:2888:3888 server.2=zookeeper1-mycompany-com:2888:3888
            server.3=0.0.0.0:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 22181:2181/tcp
        - 22888:2888/tcp
        - 23888:3888/tcp
        restart: always
    version: '3.3'
    volumes:
    orderer_mycompany_com: {}
    peer0_orga_mycompany_com: {}

================================================ ====

修改后的

docker-compose.yml文件:

    networks:
    sample:
        attachable: true
        driver: overlay
    services:
    ca_peerOrga:
        command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca_peerOrga-cert.pem
        --ca.keyfile /etc/hyperledger/fabric-ca-server-config/key_sk -b admin:PwD4AdminCA
        -d'
        environment:
        FABRIC_CA_HOME: /etc/hyperledger/fabric-ca-server
        FABRIC_CA_SERVER_CA_NAME: ca_peerOrga
        FABRIC_CA_SERVER_TLS_CERTFILE: /etc/hyperledger/fabric-ca-server-config/ca_peerOrga-cert.pem
        FABRIC_CA_SERVER_TLS_ENABLED: "True"
        FABRIC_CA_SERVER_TLS_KEYFILE: /etc/hyperledger/fabric-ca-server-config/key_sk
        'TZ: UTC': null
        image: hyperledger/fabric-ca:1.4.0
        networks:
        sample: null
        ports:
        - 7054:7054/tcp
        volumes:
        - ./crypto-config/peerOrganizations/orga_mycompany_com/ca:/etc/hyperledger/fabric-ca-server-config:rw
    cli:
        deploy:
        restart_policy:
            condition: none
            delay: 60s
        command: /bin/bash -c './scripts/init.sh;'
        depends_on:
        - ca_peerOrga
        - orderer_mycompany_com
        - peer0_orga_mycompany_com
        environment:
        CORE_PEER_ADDRESS: peer0_orga_mycompany_com:7051
        CORE_PEER_ID: cli
        CORE_PEER_LOCALMSPID: OrgaMSP
        CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/users/Admin@orga_mycompany_com/msp
        CORE_PEER_TLS_CERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/server.crt
        CORE_PEER_TLS_ENABLED: "True"
        CORE_PEER_TLS_KEY_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/server.key
        CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls/ca.crt
        CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
        FABRIC_LOGGING_SPEC: DEBUG
        GOPATH: /opt/gopath
        'TZ: UTC': null
        hostname: fabric-cli
        image: hyperledger/fabric-tools:1.4.0
        links:
        - orderer_mycompany_com
        - peer0_orga_mycompany_com
        - ca_peerOrga
        networks:
        sample: null
        ports:
        - 5050:5050/tcp
        stdin_open: true
        tty: true
        volumes:
        - /var/run:/host/var/run:rw
        - ./chaincode:/opt/gopath/src/github.com/hyperledger/fabric/chaincode:rw
        - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto:rw
        - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts:rw
        - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    couchdb0:
        environment:
        COUCHDB_PASSWORD: couchdb_pwd0
        COUCHDB_USER: couchdb_user0
        image: hyperledger/fabric-couchdb:0.4.15
        networks:
        sample: null
        ports:
        - 5984:5984/tcp
    kafka0-mycompany-com:
        container_name: kafka0-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '0'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_LOG_RETENTION_MS: '-1'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 9092:9092/tcp
        - 9093:9093/tcp
        restart: always
        volumes:
        - kafka0_mycompany_com:/tmp/kafka-logs:rw
    kafka1-mycompany-com:
        container_name: kafka1-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '1'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_LOG_RETENTION_MS: '-1'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 10092:9092/tcp
        - 10093:9093/tcp
        restart: always
        volumes:
        - kafka1_mycompany_com:/tmp/kafka-logs:rw
    kafka2-mycompany-com:
        container_name: kafka2-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '2'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_LOG_RETENTION_MS: '-1'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 11092:9092/tcp
        - 11093:9093/tcp
        restart: always
        volumes:
        - kafka2_mycompany_com:/tmp/kafka-logs:rw
    kafka3-mycompany-com:
        container_name: kafka3-mycompany-com
        depends_on:
        - zookeeper0-mycompany-com
        - zookeeper1-mycompany-com
        - zookeeper2-mycompany-com
        environment:
        KAFKA_BROKER_ID: '3'
        KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
        KAFKA_LOG_RETENTION_MS: '-1'
        KAFKA_MESSAGE_MAX_BYTES: '103809024'
        KAFKA_MIN_INSYNC_REPLICAS: '2'
        KAFKA_REPLICA_FETCH_MAX_BYTES: '103809024'
        KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: "false"
        KAFKA_ZOOKEEPER_CONNECT: zookeeper0-mycompany-com:2181,zookeeper1-mycompany-com:2181,zookeeper2-mycompany-com:2181
        image: hyperledger/fabric-kafka:0.4.15
        networks:
        sample: null
        ports:
        - 12092:9092/tcp
        - 12093:9093/tcp
        restart: always
        volumes:
        - kafka3_mycompany_com:/tmp/kafka-logs:rw
    orderer_mycompany_com:
        command: orderer
        environment:
        CONFIGTX_ORDERER_KAFKA_BROKERS: kafka0-mycompany-com:9092,kafka1-mycompany-com:9092,kafka2-mycompany-com:9092,kafka3-mycompany-com:9092
        CONFIGTX_ORDERER_ORDERERTYPE: kafka
        FABRIC_LOGGING_SPEC: debug
        ORDERER_GENERAL_GENESISFILE: /var/hyperledger/orderer/orderer.genesis.block
        ORDERER_GENERAL_GENESISMETHOD: file
        ORDERER_GENERAL_LISTENADDRESS: 0.0.0.0
        ORDERER_GENERAL_LOCALMSPDIR: /var/hyperledger/orderer/msp
        ORDERER_GENERAL_LOCALMSPID: OrdererMSP
        ORDERER_GENERAL_TLS_CERTIFICATE: /var/hyperledger/orderer/tls/server.crt
        ORDERER_GENERAL_TLS_ENABLED: "True"
        ORDERER_GENERAL_TLS_PRIVATEKEY: /var/hyperledger/orderer/tls/server.key
        ORDERER_GENERAL_TLS_ROOTCAS: '[/var/hyperledger/orderer/tls/ca.crt]'
        ORDERER_KAFKA_RETRY_SHORTINTERVAL: 1s
        ORDERER_KAFKA_RETRY_SHORTTOTAL: 100s
        ORDERER_KAFKA_VERBOSE: "true"
        'TZ: UTC': null
        image: hyperledger/fabric-orderer:1.4.0
        networks:
        sample: null
        ports:
        - 7050:7050/tcp
        volumes:
        - ./crypto-config/ordererOrganizations/mycompany_com/orderers/orderer_mycompany_com/msp:/var/hyperledger/orderer/msp:rw
        - ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block:rw
        - ./crypto-config/ordererOrganizations/mycompany_com/orderers/orderer_mycompany_com/tls:/var/hyperledger/orderer/tls:rw
        - orderer_mycompany_com:/var/hyperledger/production/orderer:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    peer0_orga_mycompany_com:
        command: sh -c "peer node start"
        depends_on:
        - couchdb0
        environment:
        CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS: couchdb0:5984
        CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD: couchdb_pwd0
        CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME: couchdb_user0
        CORE_LEDGER_STATE_STATEDATABASE: CouchDB
        CORE_LOGGING_LEVEL: DEBUG
        CORE_PEER_ADDRESS: peer0_orga_mycompany_com:7051
        CORE_PEER_CHAINCODELISTENADDRESS: 0.0.0.0:7052
        CORE_PEER_GOSSIP_EXTERNALENDPOINT: peer0_orga_mycompany_com:7051
        CORE_PEER_GOSSIP_ORGLEADER: "false"
        CORE_PEER_GOSSIP_USELEADERELECTION: "true"
        CORE_PEER_ID: peer0_orga_mycompany_com
        CORE_PEER_LOCALMSPID: OrgaMSP
        CORE_PEER_PROFILE_ENABLED: "true"
        CORE_PEER_TLS_CERT_FILE: /etc/hyperledger/fabric/tls/server.crt
        CORE_PEER_TLS_ENABLED: "True"
        CORE_PEER_TLS_KEY_FILE: /etc/hyperledger/fabric/tls/server.key
        CORE_PEER_TLS_ROOTCERT_FILE: /etc/hyperledger/fabric/tls/ca.crt
        CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE: project1_sample
        CORE_VM_ENDPOINT: unix:///host/var/run/docker.sock
        'TZ: UTC': null
        image: hyperledger/fabric-peer:1.4.0
        networks:
        sample: null
        ports:
        - 7051:7051/tcp
        - 7053:7053/tcp
        volumes:
        - ./crypto-config/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/msp:/etc/hyperledger/fabric/msp:rw
        - ./crypto-config/peerOrganizations/orga_mycompany_com/peers/peer0_orga_mycompany_com/tls:/etc/hyperledger/fabric/tls:rw
        - /var/run:/host/var/run:rw
        - peer0_orga_mycompany_com:/var/hyperledger/production:rw
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    zookeeper0-mycompany-com:
        container_name: zookeeper0-mycompany-com
        environment:
        ZOO_MY_ID: '1'
        ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zookeeper1-mycompany-com:2888:3888
            server.3=zookeeper2-mycompany-com:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 2181:2181/tcp
        - 2888:2888/tcp
        - 3888:3888/tcp
        restart: always
        volumes:
        - zookeeper0_mycompany_com:/tmp/zookeeper:rw
    zookeeper1-mycompany-com:
        container_name: zookeeper1-mycompany-com
        environment:
        ZOO_MY_ID: '2'
        ZOO_SERVERS: server.1=zookeeper0-mycompany-com:2888:3888 server.2=0.0.0.0:2888:3888
            server.3=zookeeper2-mycompany-com:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 12181:2181/tcp
        - 12888:2888/tcp
        - 13888:3888/tcp
        restart: always
        volumes:
        - zookeeper1_mycompany_com:/tmp/zookeeper:rw
    zookeeper2-mycompany-com:
        container_name: zookeeper2-mycompany-com
        environment:
        ZOO_MY_ID: '3'
        ZOO_SERVERS: server.1=zookeeper0-mycompany-com:2888:3888 server.2=zookeeper1-mycompany-com:2888:3888
            server.3=0.0.0.0:2888:3888
        image: hyperledger/fabric-zookeeper:0.4.15
        networks:
        sample: null
        ports:
        - 22181:2181/tcp
        - 22888:2888/tcp
        - 23888:3888/tcp
        restart: always
        volumes:
        - zookeeper2_mycompany_com:/tmp/zookeeper:rw
    version: '3.3'
    volumes:
    kafka0_mycompany_com: {}
    kafka1_mycompany_com: {}
    kafka2_mycompany_com: {}
    kafka3_mycompany_com: {}
    orderer_mycompany_com: {}
    peer0_orga_mycompany_com: {}
    zookeeper0_mycompany_com: {}
    zookeeper1_mycompany_com: {}
    zookeeper2_mycompany_com: {}

0 个答案:

没有答案