Tag Archives: NodeJS

Example configuration with God – Monitor nodejs

God is a very powerful process monitoring library written in Ruby. This tutorial describes how to setup a basic monitoring configuration file for a NodeJS application, telling God to restart the NodeJS app upon the process being killed (for what ever reason).

To get started, create a god/ directory within your Node app.

mkdir /var/www/sites/nodeapp/god

In this directory, create a god configuration file

vi /var/www/sites/nodeapp/god/nodeapp.god

Update the global God configuration file (Refer to previous tutorial on installing God on Ubuntu 12.04) with the location of your Node app config.

sudo vi /etc/god.conf
1
God.load '/var/www/sites/nodeapp/god/*.god'

Great, when you reload God it will start using the configuration, but first we must write the configuration file. Open your nodeapp.god config file for editing. We will start off by creating a basic configuration file that will allow you to:

  • Start node
  • Stop node
  • Restart node

Continue reading