MOHAMAD FHATIR





Arangodb Cluster Docker Deployment

shape image

Arangodb Cluster Docker Deployment

 Arangodb Cluster Docker Deployment




Arango cluster consist in 3 instance, including : 

  1. Coordinator

Coordinator is the instance which our service talk to

  1. Agency

Agency is the hearth of the cluster. It will save any configuration related to the Database, Instance, And the other agencies.

  1. 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 : 

  1. Mount any Arangodb Apps and data directory iin any instance, and make sure you do it. Otherwise, all data will be lost!

  2. Mount /tmp directories, we will use later to do arangodump and arangorestore

  3. 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 : 

  1. --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]

  2. --server.endpoint
    To state the local arangodb instance IP, Just put 0.0.0.0:8529

  3. --cluster.my-role
    To send the instance role to agency, send your role accordingly (eg: COORDINATOR)

  4. --cluster.my-address
    To send the ip address of instance to Agency, put the value (eg: tcp://10.188.1.19:8529)

  5. --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 : 

  1. --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 : 

  1. --agency.size (eg: 3)
    The number of total agency in cluster

  2. --agency.activate (eg: true)
    You have to set true if you want to activate agency

  3. --agency.supervision (eg: true)
    Perform ArangoDB cluster supervision.


Setup Database


Refer to this docker-compose (arangodb-database-example). In this document, the databas will run on 6001 port. You just have to put Command you need to add in all instances as the argument

What's Next ?


you have to set up loadbalancer, all TCP/IP loadbalancer should works. Create the front end in port 8529 and set backend to any coordinator, and voila!, you can register the cluster with front end loadbalancer IP/Port
© Copyright 2024 Mohamad Fhatir

Form WhatsApp

This order requires the WhatsApp application.

Order now