How to produce an Agency Dump
One can read out all information of an Agency in the following way:
curl -L http://<server>:<port>/_api/agency/read -d '[["/"]]'
Please make sure to use the IP (or hostname) and PORT of one Agent.
The -L
means that the curl request follows redirections in case one talks to a follower instead of the leader of the Agency.
In case of an authenticated Cluster, to access Agents a JWT token is needed.
When authentication is enabled, the user provides a “JWT-secret” to every server via the options (command line or config file). Let’s suppose the JWT-secret is geheim. To create the Agency dump, the secret first has to be turned into a token. This can be done in the following way:
jwtgen -a HS256 -s geheim -c server_id=setup -c iss=arangodb
which outputs the following text:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1Mjc2ODYzMDAsInNlcnZlcl9pZCI6InNldHVwIiwiaXNzIjoiYXJhbmdvZGIifQ.dBUhmxY3Q7rLHHDQc9FL4ghOfGiNJRFws_U2ZX4H-58
Note that the iss
values is essentially arbitrary: the crucial things in the jwtgen command above are the HS256
, the JWT secret geheim
and server_id=setup
.
jwtgen
is a node.js program that can be installed on a system with node.js
as follows:
npm install -g jwtgen
The generated token is then used in the following way with curl
, to produce the Agency dump:
curl -L http://<server>:<port>/_api/agency/read -d '[["/"]]' -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1Mjc2ODYzMDAsInNlcnZlcl9pZCI6InNldHVwIiwiaXNzIjoiYXJhbmdvZGIifQ.dBUhmxY3Q7rLHHDQc9FL4ghOfGiNJRFws_U2ZX4H-58"
Please make sure to use the IP (or hostname) and PORT of one Agent.
The two commands above can be easily executed in a single command in the following way:
curl -L http://<server>:<port>/_api/agency/read [["/"]]' -H "Authorization: bearer $(jwtgen -a H256 -s geheim -c 'iss=arangodb' -c 'server_id=setup')"
As always, use the IP (or hostname) and PORT of one Agent.
Should the Agency be down, an Agency dump can still be created starting from the database directory of (one of) the Agents. Contact ArangoDB Support, in this case, to obtain more detailed guidelines on how to produce the dump.