Professional Documents
Culture Documents
ArangoDB Cluster Administration
ArangoDB Cluster Administration
‣ Concepts
Storage engine, databases, collections, shards, indexes, authentication
‣ Cluster maintenance
Startup, shutdown, maintenance, backup and restore, rolling upgrade
‣ Resilience
Monitoring, failover, emptying a server for maintenance
‣ Troubleshooting
Log files, disaster recovery
‣ Shard
A partition of collection data. Every cluster wide collection is sharded with respect to
the collection’s _key per default. Any access to collection discriminated its sharding
key.
‣ Agency
Arangospeak for the central configuration store and supervision process of a cluster.
The agency consists of a typically small number of ArangoDB instances, which
establish consensus by means of the RAFT* consensus protocol. The agency is the
animal brain of the cluster.
* Proceeding USENIX ATC'14 Proceedings of the 2014 USENIX conference on USENIX, Pages 305-320
Copyright © ArangoDB GmbH, 2018 4
Cluster nomenclature
‣ Supervision
A service, that resides in the agency, which monitors the cluster's over all health. It
enacts both own jobs and user jobs on configuration changes like hardware
failover and shard movement.
‣ Coordinator emphasis
#coordinators > #db servers, 3 agents. This approach works best in cases where you need more CPU power for Foxx
services. Foxx services run on coordinators. By adding machines that only host coordinators, you allow for greater CPU
usage for these services.
‣ DB server emphasis
#coordinators < #db servers, 3 agents. This approach is useful in cases where you need to increase data capacity more
than you need to improve query performance. It introduces a lesser bottleneck as there are fewer coordinators to
receive client connections.
‣ Application coordinators
#coordinators == #application servers coordinators are on the same machines, which server the application separating
coordinators from the DB servers and agents. Avoid the network hop between the application and the coordinators,
decreasing latency.
Copyright © ArangoDB GmbH, 2018 12
Anatomy - Bootstrapping an cluster
The goto method of creating an ArangoDB cluster is
that of the ArangoDB starter.
‣ Initial configuration
‣ Service discovery
‣ Cluster startup
‣ Cluster shutdown
‣ Desaster recovery
The above will create an arangodb cluster with 3 instances of agent, db server and
coordinator. The 3 coordinators are reachable under
http://[::]:8529, http://[::]:8534 and http://[::]:8539
--agency.my-address The ip address of this agent on the cluster's network. This parameter must be
specified as often infrastructures come with multiple networks and automated
choices would often be wrong.
--agency.endpoint This parameter can be specified multiple times. It is a means to inform a starting
agent to one or more of its peers. The same peer, a circular pattern or all peers
may be specified at start time. The key here is that all agents are capable to
complete their list of peers through gossiping.
‣ Rest API
curl <coordinator>/_api/database -d{"name":"test_db"}
Above actions will need a couple of seconds to finish as in the backend multiple db servers are enacting the
creation of system collections and initially setting up their replication.
‣ Rest API:
curl <coordinator>/_api/database/test_db -XDELETE
‣ Rest API
arangosh> db._create("foo", {numberOfShards:3, replationFactor:2})
‣ Rest API:
arangosh> db._drop("foo")
‣ Rest API
https://docs.arangodb.com/latest/HTTP/Indexes/WorkingWith.html
✴ Note that the kill commands orderly shutdown every single process. Subsequently, the starter
process takes immediate action to respawn the process. This is done with the updated arangodb
binary.
✴ Note that it is of utmost importance that backups of the data directories is performed ahead of
the upgrade process
"configuration": {
We hope you enjoyed the course and it helped you get started with the ArangoDB Cluster
Feedback to the course Add “ArangoDB” to your skills Tweet about ArangoDB