guvnor

3.5.17 • Public • Published
Control your processes like a boss

The Guv'nor

Discuss Tasks Build Status Dependency Status Coverage Status

Noun 1. guvnor - (British slang) boss

A node process manager that isn't spanners all the way down.

Features

  • Monitoring via console or web
  • Configure user/group to run processes as
  • Auto process restart on crash
  • Log redirection to per process out/err files
  • Cluster support
  • Monitor process CPU/memory/event loop latency
  • Remotely trigger GC/heap dump
  • Debug remote processes
  • Store exception stack traces and logs for post-crash analysis

Command line interface

cli

Use guv (or guvnor if you're not into the whole brevity thing).

Web interface

Start the web interface with (can be run without guvnor running in the background - for example if you want to monitor one or more guvnor servers from a different machine that is not running guvnor):

$ guv-web

or run the web interface under guvnor itself (please read the guvnor web setup section first!):

$ guv web

guvnor-web

Install

npm install -g guvnor --unsafe-perm

Why --unsafe-perm? Guvnor uses a fair few native modules that require access to /root/.npm and /root/.node-gyp when building. At the moment this is the only way to allow access.

Upgrading

npm's upgrade command is a big angry box of wasps so to be sure, kill guvnor, remove it, reinstall and start it.

guv kill
npm remove -g guvnor
npm install -g guvnor
guv

For instructions on how to move between breaking versions, see upgrading

Usage

Comprehensive help is available on the command line:

guv --help

and with more detail for each subcommand, e.g.:

guv start --help

The first time you invoke a guvnor command, the daemon will start in the background. Because guvnor can run processes as different users, it needs to be able to switch to those users. Consequently you should start guvnor as root or another privileged user.

Help

  1. Starting and stopping processes
  2. Controlling the Daemon
  3. Managing clusters
  4. Installing and running apps
  5. Remote access and monitoring (e.g. guvnor-web)
  6. Web interface
  7. Web interface - configuration
  8. Web interface - user management
  9. Programmatic access
  10. Programmatic access - local
  11. Programmatic access - remote
  12. Programmatic access - events

Configure

A configuration file if run as root can be placed at /etc/guvnor/guvnor. Take a look at the default configuration file for details.

If you create a configuration file, it will be merged with the default configuration, so if you only want to override one property, you need only specify one property in your config file.

Starting guvnor on boot

Guvnor comes with a sysv init script. To configure it to run on system boot run the following:

$ sudo ln -s /usr/local/lib/node_modules/guvnor/scripts/init/sysv/guvnor /etc/init.d/guvnor
$ sudo update-rc.d guvnor defaults

To undo this, run:

$ sudo update-rc.d guvnor remove
$ sudo rm /etc/init.d/guvnor

apt-get

If you installed node via apt-get install nodejs, you should create a symlink to the nodejs binary:

$ sudo ln -s /usr/bin/nodejs /usr/bin/node

Also, the init script is probably stored at /usr/lib/node_modules/... instead of /usr/local/lib/node_modules/... - please check your filesystem to be sure.

Docker

See the sample Dockerfile for how to run guvnor with Docker.

In the Dockerfile there are two variables - GUVNOR_ROOT_SECRET and GUVNOR_USER_SECRET - you should change these to a long random string unique to your install before building the container.

Once you'd done that, build the container and run it with the commands below. The -p option forwards a port used by guv-web to connect to the instance of guvnor in the container, so forward the port as appropriate to your setup.

$ sudo docker build -t guvnor .
$ sudo docker run -p 57484:57483 -d guvnor

To connect guv-web to your docker container, add something like the below to your guvnor-web-hosts file:

[docker]
  host = localhost
  port = 57484
  user = root
  secret = GUVNOR_ROOT_SECRET

...and to your guvnor-web-users file:

[alex.docker]
  user = guvnor
  secret = GUVNOR_USER_SECRET

Replace GUVNOR_ROOT_SECRET and GUVNOR_USER_SECRET with whatever you defined in the Dockerfile.

Development

Vagrant setup

It's useful to be able to set up and tear down fresh VMs to do testing, so a Vagrant file is available. It's configured to run Debian Jessie and install the latest versions of Node and Guvnor.

Once Vagrant is installed, cd into the vagrant directory and run:

$ vagrant up
$ vagrant ssh
$ sudo npm install -g guvnor

Then when you are done, to shut the machine down exit your SSH session and run:

$ vagrant destroy

Docker

Install docker on vagrant with

wget -qO- https://get.docker.com/ | sh

Then cd to /docker and build & run guvnor

sudo docker build -t guvnor .
sudo docker run -p 60000-60020:60000-60020 -d guvnor

Changelog

See the changelog

Package Sidebar

Install

npm i guvnor

Weekly Downloads

1

Version

3.5.17

License

MIT

Last publish

Collaborators

  • achingbrain