代码之家  ›  专栏  ›  技术社区  ›  Cassie

OrientDB分布式模式Docker

  •  0
  • Cassie  · 技术社区  · 8 年前

    我的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
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   Cassie    7 年前

    我为每个节点创建了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