OrientDB分布式模式Docker

OrientDB distributed mode Docker

我想 运行 在集群中至少有 2 个节点的分布式模式下使用 OrientDB。所以我想知道将 Distributed 标志设置为 true 是否足够或者是否应该有更多配置?

我的 docker-compose 文件如下所示:

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

我已经使用一组单独的配置为每个节点创建了 2 个服务:

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