0
votes

I would like to run OrientDB in a distributed mode with at least 2 nodes in a cluster. So I would like to know if setting a Distributed flag to true is enough or should there be some more configurations?

My docker-compose file looks like this:

node1:
  image: orientdb:latest
  ports:
  - "2424:2424"
  - "2480:2480"
  environment:
    ORIENTDB_ROOT_PASSWORD: 'pwd'
    ORIENTDB_NODE_NAME: node1
  volumes:
  - /orientdb/config:/opt/orientdb/config
  - /orientdb/databases:/orientdb/databases
  - /orientdb/backup:/orientdb/backup
  - ./data:/orientdb/bin/data
  command: /orientdb/bin/server.sh  -Ddistributed=true
1

1 Answers

0
votes

I have created 2 services for each nodes with a separate set of configs:

version: '3'
services:
  node1:
    image: orientdb:latest
    entrypoint: /orientdb/bin/server.sh -Ddistributed=true
    volumes:
      - /orientdb/config:/orientdb/config
      - /orientdb/databases:/orientdb/databases
      - /orientdb/backup:/orientdb/backup
      - ./data:/orientdb/bin/data
    environment:
      ORIENTDB_ROOT_PASSWORD: 'pwd'
      ORIENTDB_NODE_NAME: node1
    ports:
      - "2424:2424"
      - "2480:2480"

  node2:
    image: orientdb:latest
    entrypoint: /orientdb/bin/server.sh -Ddistributed=true
    volumes:
      - /orientdb/config2:/orientdb/config
      - /orientdb/databases2:/orientdb/databases
      - /orientdb/backup2:/orientdb/backup
      - ./data:/orientdb/bin/data
    environment:
      ORIENTDB_ROOT_PASSWORD: 'pwd'
      ORIENTDB_NODE_NAME: node2
    depends_on:
      - node1