Running arangod via PM2

ecosystem.config.js:

1
2
3
4
5
6
7
8
module.exports = {
apps : [{
name: 'db',
script: 'arangod',
interpreter: 'none',
cwd: '<ArangoDB installation path>',
args: '-c <arangod.conf path>',
}],

arangod.conf:

1
2
3
4
5
6
7
8
# Omitted unchanged part

[javascript]
# startup-directory = @ROOTDIR@/usr/share/arangodb3/js
# If @ROOTDIR@ does not work so that `startup-directory` is incorrect, use the following:
startup-directory = <ArangoDB installation path>/usr/share/arangodb3/js

# Omitted unchanged part

One thing is unresolved that pm2 stop or pm2 delete are not properly killing arangod. I will update later if there is a way…