fabric-zookeeper 集群部署

部署机器: 172.17.3.146/145/144

zookeeper_0.yaml

version: '2'
services:
    zookeeper0:
    image: hyperledger/fabric-zookeeper
    restart: always
    ports:
        - '2181:2181'
        - '2888:2888'
        - '3888:3888'
    environment:
      - ZOO_MY_ID=1
      - ZOO_SERVERS=server.1=0.0.0.0:2888:3888 server.2=172.17.3.145:2888:3888 server.3=172.17.3.144:2888:3888

zookeeper_1.yaml

version: '2'
services:
    zookeeper0:
    image: hyperledger/fabric-zookeeper
    restart: always
    ports:
        - '2181:2181'
        - '2888:2888'
        - '3888:3888'
    environment:
      - ZOO_MY_ID=2
      - ZOO_SERVERS=server.1=172.17.3.146:2888:3888 server.2=0.0.0.0:2888:3888 server.3=172.17.3.144:2888:3888

zookeeper_2.yaml

version: '2'
services:
    zookeeper0:
    image: hyperledger/fabric-zookeeper
    restart: always
    ports:
        - '2181:2181'
        - '2888:2888'
        - '3888:3888'
    environment:
      - ZOO_MY_ID=3
      - ZOO_SERVERS=server.1=172.17.3.146:2888:3888 server.2=172.17.3.145:2888:3888 server.3=0.0.0.0:2888:3888

注意点:
ZOO_MY_ID不能重复
ZOO_SERVERS本机的需要修改0.0.0.0,如果写为ip,则2888:3888只为本机开放,外面机器无法访问。

你可能感兴趣的:(fabric-zookeeper 集群部署)