Skip to content

Commit 6638e0f

Browse files
committed
Merged in master
2 parents 2f95ba4 + 2dc76aa commit 6638e0f

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changes from version 0.10.4 to master
22

33
- For `activefailover` deployments, the message where to reach your database is now only shown for the current leader.
4+
- Added SystemD example. See `examples/systemd/README.md`.
45
- Added `--log.dir` option to configure a custom directory to which all log files will be written.
56
- It is no longer allowed to use `log.file` as a passthrough option.
67
- Added `--starter.host` option, to bind the HTTP server to a specific network interface instead of the default `0.0.0.0`.

examples/systemd/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Run ArangoDB Starter with SystemD
2+
3+
This example shows how you can run the ArangoDB starter in a systemd service.
4+
5+
The example will run the starter as user `arangodb` in group `arangodb`.
6+
It requires an environment variable file called `/etc/arangodb.env`
7+
with the following variables.
8+
9+
```text
10+
STARTERENDPOINTS=<comma seperated list of endpoints of all starters (for --starter.join)>
11+
CLUSTERSECRET=<JWT secret used by the cluster>
12+
CLUSTERSECRETPATH=<full path of file containing the JWT secret used by the cluster>
13+
```
14+
15+
To use this service, do the following on every machine on which the starter should run:
16+
17+
- Create the `/etc/arangodb.env` environment file as specified above.
18+
- Copy the `arangodb.service` file to `/etc/systemd/system/arangodb.service`.
19+
- Trigger a systemd reload using `sudo systemctl daemon-reload`.
20+
- Enable the service using `sudo systemctl enable arangodb.service`.
21+
- Start the service using `sudo systemctl start arangodb.service`.
22+
23+
Once started, you can view the logs of the starter using:
24+
25+
```bash
26+
sudo journalctl -flu arangodb.service
27+
```

examples/systemd/arangodb.service

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[Unit]
2+
Description=Run the ArangoDB Starter
3+
After=network.target
4+
5+
[Service]
6+
Restart=on-failure
7+
User=arangodb
8+
Group=arangodb
9+
EnvironmentFile=/etc/arangodb.env
10+
Environment=DATADIR=/var/lib/arangodb/cluster
11+
ExecStartPre=/usr/bin/sh -c "mkdir -p $(dirname $CLUSTERSECRETPATH)"
12+
ExecStartPre=/usr/bin/sh -c "mkdir -p ${DATADIR}"
13+
ExecStartPre=/usr/bin/sh -c "echo ${CLUSTERSECRET} > ${CLUSTERSECRETPATH}"
14+
ExecStart=/usr/bin/arangodb \
15+
--starter.data-dir=${DATADIR} \
16+
--starter.join=${STARTERENDPOINTS} \
17+
--server.storage-engine=rocksdb \
18+
--auth.jwt-secret=${CLUSTERSECRETPATH} \
19+
--all.log.level=info --all.log.output=+
20+
TimeoutStopSec=60
21+
22+
[Install]
23+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)