Using the ArangoDB Starter

This section describes how to start an Active Failover setup the tool Starter(the arangodb binary program).

Local Tests

If you want to start a local Active Failover setup quickly, use the —starter.localoption of the Starter. This will start all servers within the context of a singlestarter process:

  1. arangodb --starter.local --starter.mode=activefailover --starter.data-dir=./localdata

Note: When you restart the Starter, it remembers the original —starter.local flag.

Multiple Machines

If you want to start an Active Failover setup using the Starter, use the —starter.mode=activefailoveroption of the Starter. A 3 “machine” Agency is started as well as 2 single servers,that perform asynchronous replication and failover:

  1. arangodb --starter.mode=activefailover --server.storage-engine=rocksdb --starter.data-dir=./data --starter.join A,B,C

Run the above command on machine A, B & C.

The Starter will decide on which 2 machines to run a single server instance.To override this decision (only valid while bootstrapping), add a—cluster.start-single=false to the machine where the single serverinstance should not be started.

Once all the processes started by the Starter are up and running, and joined theActive Failover setup (this may take a while depending on your system), the Starter will informyou where to connect the Active Failover from a Browser, shell or your program.

For a full list of options of the Starter please refer to thissection.

Using the ArangoDB Starter in Docker

The Starter can also be used to launch an Active Failover setup based on _Docker_containers. To do this, you can use the normal Docker arguments, combined with—starter.mode=activefailover:

  1. export IP=<IP of docker host>
  2. docker volume create arangodb
  3. docker run -it --name=adb --rm -p 8528:8528 \
  4. -v arangodb:/data \
  5. -v /var/run/docker.sock:/var/run/docker.sock \
  6. arangodb/arangodb-starter \
  7. --starter.address=$IP \
  8. --starter.mode=activefailover \
  9. --starter.join=A,B,C

Run the above command on machine A, B & C.

The Starter will decide on which 2 machines to run a single server instance.To override this decision (only valid while bootstrapping), add a—cluster.start-single=false to the machine where the single serverinstance should not be started.

If you use an ArangoDB version of 3.4 or above and use the EnterpriseEdition Docker image, you have to set the license key in an environmentvariable by adding this option to the above docker command:

  1. -e ARANGO_LICENSE_KEY=<thekey>

You can get a free evaluation license key by visiting:

www.arangodb.com/download-arangodb-enterprise/

Then replace <thekey> above with the actual license key. The startwill then hand on the license key to the Docker containers it launchesfor ArangoDB.

TLS verified Docker services

Oftentimes, one needs to harden Docker services using client certificate and TLS verification. The Docker API allows subsequently only certified access.As the ArangoDB starter starts the ArangoDB cluster instances using this Docker API, it is mandatory that the ArangoDB starter is deployed with the proper certificateshanded to it, so that the above command is modified as follows:

  1. export IP=<IP of docker host>
  2. export DOCKER_TLS_VERIFY=1
  3. export DOCKER_CERT_PATH=/path/to/certificate
  4. docker volume create arangodb
  5. docker run -it --name=adb --rm -p 8528:8528 \
  6. -v arangodb:/data \
  7. -v /var/run/docker.sock:/var/run/docker.sock \
  8. -v /path/to/certificate:/path/to/certificate
  9. arangodb/arangodb-starter \
  10. --starter.address=$IP \
  11. --starter.mode=activefailover \
  12. --starter.join=A,B,C

Note that the environment variables DOCKER_TLS_VERIFY and DOCKER_CERT_PATH as well as the additional mountpoint containing the certificate have been added above. directory. The assignment of DOCKER_CERT_PATH is optional, in which case it is mandatory that the certificates are stored in $HOME/.docker. Sothe command would then be as follows

  1. export IP=<IP of docker host>
  2. docker volume create arangodb
  3. docker run -it --name=adb --rm -p 8528:8528 \
  4. -v arangodb:/data \
  5. -v /var/run/docker.sock:/var/run/docker.sock \
  6. -v /path/to/cert:/root/.docker \
  7. -e DOCKER_TLS_VERIFY=1 \
  8. arangodb/arangodb-starter \
  9. --starter.address=$IP \
  10. --starter.mode=activefailover \
  11. --starter.join=A,B,C