0

我正在尝试在 Docker 中设置一个具有 3 个节点的 CrateDB 4.0.4 社区集群。

更新:

最后,我得到了 crate 4.0.4 中的集群。它只对我有用 Cnode.name 属性。通过使用主机名集群没有出现。

crate01:
  image: crate
  container_name: crate01
  hostname: crate01
  ports:
    - 4201:4200
  volumes:
    - /tmp/crate/01:/data
  command: >
    crate -Cnetwork.host=_site_
    -Cnode.name=crate01
    -Cdiscovery.seed_hosts=crate02,crate03
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g
crate02:
  image: crate
  container_name: crate02
  hostname: crate02
  ports:
    - 4202:4200
  volumes:
    - /tmp/crate/02:/data
  command: >
    crate -Cnetwork.host=_site_
    -Cnode.name=crate02
   -Cdiscovery.seed_hosts=crate01,crate03
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g

crate03:
  image: crate
  container_name: crate03
  hostname: crate03
  ports:
    - 4203:4200
  volumes:
    - /tmp/crate/03:/data
  command: >
    crate -Cnetwork.host=_site_
    -Cnode.name=crate03
    -Cdiscovery.seed_hosts=crate01,crate02
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g
4

1 回答 1

0

请试试这个docker-compose.yml内容

crate01:
  image: crate
  container_name: crate01
  hostname: crate01
  ports:
    - 4201:4200
  net: crate
  command: >
    crate -Cnetwork.host=_site_
    -Cdiscovery.seed_hosts=crate02,crate03
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g

crate02:
  image: crate
  container_name: crate02
  hostname: crate02
  ports:
    - 4202:4200
  net: crate
  command: >
    crate -Cnetwork.host=_site_
    -Cdiscovery.seed_hosts=crate01,crate03
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g

crate03:
  image: crate
  container_name: crate03
  hostname: crate03
  ports:
    - 4203:4200
  net: crate
  command: >
    crate -Cnetwork.host=_site_
    -Cdiscovery.seed_hosts=crate01,crate02
    -Ccluster.initial_master_nodes=crate01,crate02,crate03
  environment:
    - CRATE_HEAP_SIZE=2g
于 2019-09-25T13:07:42.043 回答