Arangodb Cluster Docker Deployment
Arangodb Cluster Docker Deployment
Arango cluster consist in 3 instance, including :
Coordinator
Coordinator is the instance which our service talk to
Agency
Agency is the hearth of the cluster. It will save any configuration related to the Database, Instance, And the other agencies.
Database
Database is the place where the data/shards are stored
Visit this Documentation by Arangodb to learn more
In this document we approach cluster deployment through docker.
Before we proceed, please note the important things below :
Mount any Arangodb Apps and data directory iin any instance, and make sure you do it. Otherwise, all data will be lost!
Mount /tmp directories, we will use later to do arangodump and arangorestore
Mount your localtime folder, so we don’t have to set up timezone
'/usr/share/zoneinfo/Asia/Jakarta:/etc/localtime'
Known limitation
Before launch into production PLEASE DEPLOY CLUSTER IN DEVELOPMENT FIRST so we can fix and acknowledge any limitations.
You can find all limitation from Arangodb Docs cluster vs single-instance
As my personal experience, some golang services need to be added WITH and state the collection before running queries
Command you need to add in all instances
Any instances in cluster should be contain these values :
--server.jwt-secret-keyfile
Auth file between instance, so they can login with passwordless. Please refer to this link to generate secret keyfile [Arangodb Docs]--server.endpoint
To state the local arangodb instance IP, Just put 0.0.0.0:8529--cluster.my-role
To send the instance role to agency, send your role accordingly (eg: COORDINATOR)--cluster.my-address
To send the ip address of instance to Agency, put the value (eg: tcp://10.188.1.19:8529)--agency.endpoint (eg: tcp://10.188.1.19:5001)
To provision the instance to agency, apply to coordinator and database only
Setup coordinator
For coordinator, always set the port to 8529. Please refer to this docker-compose (arangodb-coordinator-example). And since coordinator like cluster “head”, any cluster arguments, dump, and restore will be executed in coordinator.
Command Explanation :
--cluster.default-replication-factor
If you create the collection, this value determine the total data replication for each shard. So if you have 3 database, you have to set 3 to guarantee maximum availability
Setup Agency
Refer to this docker-compose (arangodb-agency-example). We will set up the ports to 5001 and because by default arangadb runs in 8529, we have to state the port number in docker-compose file.
Command Explanation :
--agency.size (eg: 3)
The number of total agency in cluster--agency.activate (eg: true)
You have to set true if you want to activate agency--agency.supervision (eg: true)
Perform ArangoDB cluster supervision.

