There are a few ways you can launch AMIE on your environment. Depending on how you want to deploy it. I tried to make it as easy to get started yet lay the initial framework to scale it out if or when needed.
This example service file is using root (for simplicity sake) but you should create a system process account for it to run as (amie
or svc_amie
).
Example: useradd -rs /bin/false svc_amie
[Service]
User=svc_amie
Group=svc_amie
# Create and edit a Unit (Service) file.
# In systemd , a unit refers to any resource that the system knows how to operate on and manage.
# This is the primary object that the systemd tools use to manage processes
nano /etc/systemd/system/amie.service
[Unit]
Description=AMIE - Automated Monitoring Integration Engine
Wants=network-online.target
After=network-online.target
[Service]
User=root
Group=root
Type=simple
ExecStart=/usr/bin/node /amie_server/server.js
WorkingDirectory=/amie_server/
Restart=on-failure
[Install]
WantedBy=multi-user.target
# Then create symlinks for it and reload the daemon
systemctl daemon-reload
# Launch the service
systemctl start amie.service
nohup node server.js > /amie_server/logs/amie_api.log &
Note: This does ask to be installed as a global
package and you need to decide for yourself if you want to allow any kind of global packages in your environment.
With that being said, this is a really slick utility and provides a nice alternative to native systemd. It also allows for load balancing and nodemon
style process managing --watch
. If anything it is work installing on a cloud vm and evaluate it for yourself before making the decision on what will manage your running application.