fabric-zookeeper 集群部署

2018-04-18  本文已影响0人  小二郎_读书

部署机器: 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只为本机开放,外面机器无法访问。

上一篇下一篇

猜你喜欢

热点阅读