简体   繁体   中英

Setting Up CrateDB 4.0.4 Cluster

I am trying to set up a CrateDB 4.0.4 Community Cluster with 3 Nodes in Docker.

Update:

At the end I got the cluster in crate 4.0.4 coming up. It only worked for me with Cnode.name property. By using the Hostname cluster did not come up.

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

Please try this docker-compose.yml content

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM