Skip to content

Instantly share code, notes, and snippets.

@mikestaub
Last active April 4, 2020 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikestaub/027e8f030130fd2296d3fd985a1748cf to your computer and use it in GitHub Desktop.
Save mikestaub/027e8f030130fd2296d3fd985a1748cf to your computer and use it in GitHub Desktop.
Get started with arangodb by running a cluster with docker-compose. 3 db servers, 3 coordinators, and 3 agents. Visit http://localhost:8080 to view databases
version: "3"
# contents of ./nginx.conf
# worker_processes 1;
# events {
# worker_connections 1024;
# }
# http {
# upstream arangodb-servers {
# server arangodb-coordinator1:8529;
# server arangodb-coordinator2:8529;
# server arangodb-coordinator3:8529;
# }
# server {
# listen 80;
# location / {
# proxy_pass http://arangodb-servers;
# }
# }
# }
services:
nginx:
image: nginx:1.17.9
container_name: arangodb-proxy
depends_on:
- arangodb-coordinator1
- arangodb-coordinator2
- arangodb-coordinator3
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 8080:80
arangodb-coordinator1:
container_name: arangodb-coordinator1
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
ports:
- "8529:8529" # web UI
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-coordinator1:8529
--cluster.my-role COORDINATOR
arangodb-coordinator2:
container_name: arangodb-coordinator2
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
ports:
- "8530:8529"
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-coordinator2:8529
--cluster.my-role COORDINATOR
arangodb-coordinator3:
container_name: arangodb-coordinator3
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
ports:
- "8531:8529"
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-coordinator2:8529
--cluster.my-role COORDINATOR
arangodb-agency1:
container_name: arangodb-agency1
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--foxx.queues false
--agency.size 3
--agency.supervision true
--agency.activate true
--agency.my-address tcp://arangodb-agency1:8529
--agency.endpoint tcp://arangodb-agency1:8529
--agency.endpoint tcp://arangodb-agency2:8529
--agency.endpoint tcp://arangodb-agency3:8529
arangodb-agency2:
container_name: arangodb-agency2
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics false
--agency.size 3
--agency.supervision true
--agency.activate true
--agency.my-address tcp://arangodb-agency2:8529
--agency.endpoint tcp://arangodb-agency1:8529
--agency.endpoint tcp://arangodb-agency2:8529
--agency.endpoint tcp://arangodb-agency3:8529
depends_on:
- arangodb-agency1
arangodb-agency3:
container_name: arangodb-agency3
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics false
--agency.size 3
--agency.supervision true
--agency.activate true
--agency.my-address tcp://arangodb-agency3:8529
--agency.endpoint tcp://arangodb-agency1:8529
--agency.endpoint tcp://arangodb-agency2:8529
--agency.endpoint tcp://arangodb-agency3:8529
depends_on:
- arangodb-agency1
arangodb-dbserver1:
container_name: arangodb-dbserver1
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-dbserver1:8529
--cluster.my-role PRIMARY
--database.directory /var/lib/arangodb3/primary1
volumes:
- arangodb-dbserver1:/var/lib/arangodb3
arangodb-dbserver2:
container_name: arangodb-dbserver2
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8529
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-dbserver2:8529
--cluster.my-role PRIMARY
--database.directory /var/lib/arangodb3/primary2
volumes:
- arangodb-dbserver2:/var/lib/arangodb3
arangodb-dbserver3:
container_name: arangodb-dbserver3
image: arangodb/arangodb:3.6.1
environment:
- ARANGO_NO_AUTH=1
command: >
--server.endpoint tcp://0.0.0.0:8539
--server.authentication false
--server.statistics true
--cluster.agency-endpoint tcp://arangodb-agency1:8529
--cluster.agency-endpoint tcp://arangodb-agency2:8529
--cluster.agency-endpoint tcp://arangodb-agency3:8529
--cluster.my-address tcp://arangodb-dbserver3:8539
--cluster.my-role PRIMARY
--database.directory /var/lib/arangodb3/primary3
volumes:
- arangodb-dbserver3:/var/lib/arangodb3
volumes:
arangodb-dbserver1: null
arangodb-dbserver2: null
arangodb-dbserver3: null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment