我想在集群中至少有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
答案 0 :(得分:0)
我为每个节点创建了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