Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes from version 0.10.4 to master

- Added SystemD example. See `examples/systemd/README.md`.
- Added `--log.dir` option to configure a custom directory to which all log files will be written.
- It is no longer allowed to use `log.file` as a passthrough option.
- Added `--starter.host` option, to bind the HTTP server to a specific network interface instead of the default `0.0.0.0`.
Expand Down
27 changes: 27 additions & 0 deletions examples/systemd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Run ArangoDB Starter with SystemD

This example shows how you can run the ArangoDB starter in a systemd service.

The example will run the starter as user `arangodb` in group `arangodb`.
It requires an environment variable file called `/etc/arangodb.env`
with the following variables.

```text
STARTERENDPOINTS=<comma seperated list of endpoints of all starters (for --starter.join)>
CLUSTERSECRET=<JWT secret used by the cluster>
CLUSTERSECRETPATH=<full path of file containing the JWT secret used by the cluster>
```

To use this service, do the following on every machine on which the starter should run:

- Create the `/etc/arangodb.env` environment file as specified above.
- Copy the `arangodb.service` file to `/etc/systemd/system/arangodb.service`.
- Trigger a systemd reload using `sudo systemctl daemon-reload`.
- Enable the service using `sudo systemctl enable arangodb.service`.
- Start the service using `sudo systemctl start arangodb.service`.

Once started, you can view the logs of the starter using:

```bash
sudo journalctl -flu arangodb.service
```
23 changes: 23 additions & 0 deletions examples/systemd/arangodb.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=Run the ArangoDB Starter
After=network.target

[Service]
Restart=on-failure
User=arangodb
Group=arangodb
EnvironmentFile=/etc/arangodb.env
Environment=DATADIR=/var/lib/arangodb/cluster
ExecStartPre=/usr/bin/sh -c "mkdir -p $(dirname $CLUSTERSECRETPATH)"
ExecStartPre=/usr/bin/sh -c "mkdir -p ${DATADIR}"
ExecStartPre=/usr/bin/sh -c "echo ${CLUSTERSECRET} > ${CLUSTERSECRETPATH}"
ExecStart=/usr/bin/arangodb \
--starter.data-dir=${DATADIR} \
--starter.join=${STARTERENDPOINTS} \
--server.storage-engine=rocksdb \
--auth.jwt-secret=${CLUSTERSECRETPATH} \
--all.log.level=info --all.log.output=+
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target