ArangoSync Master

The ArangoSync Master is responsible for managing all synchronization, creating tasks and assigning those to the ArangoSync Workers.

At least 2 instances must be deployed in each datacenter. One instance will be the “leader”, the other will be an inactive slave. When the leader is gone for a short while, one of the other instances will take over.

With clusters of a significant size, the sync master will require a significant set of resources. Therefore it is recommended to deploy the sync masters on their own servers, equipped with sufficient CPU power and memory capacity.

To start an ArangoSync Master using a systemd service, use a unit like this:

  1. [Unit]
  2. Description=Run ArangoSync in master mode
  3. After=network.target
  4. [Service]
  5. Restart=on-failure
  6. EnvironmentFile=/etc/arangodb.env
  7. EnvironmentFile=/etc/arangodb.env.local
  8. LimitNOFILE=8192
  9. ExecStart=/usr/sbin/arangosync run master \
  10. --log.level=debug \
  11. --cluster.endpoint=${CLUSTERENDPOINTS} \
  12. --cluster.jwtSecret=${CLUSTERSECRET} \
  13. --server.keyfile=${CERTIFICATEDIR}/tls.keyfile \
  14. --server.client-cafile=${CERTIFICATEDIR}/client-auth-ca.crt \
  15. --server.endpoint=https://${PRIVATEIP}:${MASTERPORT} \
  16. --server.port=${MASTERPORT} \
  17. --master.endpoint=${PUBLICMASTERENDPOINTS} \
  18. --master.jwtSecret=${MASTERSECRET} \
  19. --mq.type=direct
  20. TimeoutStopSec=60
  21. [Install]
  22. WantedBy=multi-user.target

The sync master needs a TLS server certificate and a If you want the service to create a TLS certificate & client authentication certificate, for authenticating with ArangoSync Masters in another datacenter, for every start, add this to the Service section.

  1. ExecStartPre=/usr/bin/sh -c "mkdir -p ${CERTIFICATEDIR}"
  2. ExecStartPre=/usr/sbin/arangosync create tls keyfile \
  3. --cacert=${CERTIFICATEDIR}/tls-ca.crt \
  4. --cakey=${CERTIFICATEDIR}/tls-ca.key \
  5. --keyfile=${CERTIFICATEDIR}/tls.keyfile \
  6. --host=${PUBLICIP} \
  7. --host=${PRIVATEIP} \
  8. --host=${HOST} \
  9. --host=${CLUSTERDNSNAME}

The ArangoSync Master must be reachable on a TCP port ${MASTERPORT} (used with --server.port option). This port must be reachable from inside the datacenter (by sync workers and operations) and from inside of the other datacenter (by sync masters in the other datacenter).

Note that other sync masters in the same datacenter will contact this sync master through the endpoint specified in --server.endpoint. Sync masters (and sync workers) from the other datacenter will contact this sync master through the endpoint specified in --master.endpoint.

Since the sync masters can be CPU intensive when running lots of databases & collections, it is recommended to run them on dedicated machines with a lot of CPU power.

Consider these machines crucial for you DC2DC replication setup.