NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

Prerequisites

Icon

The information here assumes that your production host is a Linux system.

Make sure you have installed Node on the production host.  See https://nodejs.org/ for information on installing Node

To monitor performance metrics (CPU and heap consumption, event loop metrics, and so on), the system must have compiler tools, which are standard on most Linux systems.  For more information, see Installing compiler tools.

Icon

To generate and view metrics, you must have:

  • A standard set of C++ compiler tools on the system running the application.  See Installing compiler tools for more information.
  • A valid StrongLoop license key on the system running the application.
    You automatically get a free trial license valid for 30-days from when you first run Arc that applies to apps running locally within Arc. See Managing your licenses for more information.

Install using npm and run PM service

Icon

Installing StrongLoop PM as a service is not compatible with nvm.

Follow these steps on each production system:

  1. Install StrongLoop PM with npm.
  2. Install and run the StrongLoop PM service.
Icon

Installing just the strong-pm package rather than the full strongloop package is preferable on a production system, because it contains only the StrongLoop Process Manager and its runtime dependencies, not all the development-time packages, such as LoopBack, the StrongLoop development tools, slc and Arc, and so on, that you need on a development system.

When you install strong-pm package, you must use the sl-pm-install and sl-pm commands. Where you've installed the full strongloop package, you can also use slc pm and slc pm-install, which are equivalent.

Install npm package

On each production host, install the standalone StrongLoop Process Manager module (strong-pm), rather than the version packaged with the full StrongLoop installation:

If you encounter problems, first try:

If you still encounter issues such as file permission errors, consult Installation troubleshooting.

Install and run the service

On each host, install Process Manager as an operating system service, then run the service.  The specific command depends on the operating system.

Icon

Use the the slc pm-install or sl-pm-install command to install StrongLoop Process Manager as a service on Linux distributions that support Upstart or systemd.

By default, the command uses Upstart 1.4 or newer. The default will work, for example on Ubuntu 12.04, 12.10, 13.04, 13.10, 14.04, or 14.10. Otherwise:

  • On systems with Upstart 0.6 - 1.3.x (for example Ubuntu 10.04, CentOS, or AWS Linux), use the --upstart 0.6 option.
  • On systems that support systemd instead (for example RHEL 7, Ubuntu 15.04 /15.10, Fedora, or OpenSUSE), use the --systemd option.

By default, the StrongLoop Process Manager service listens on port 8701. To make it listen on a different port, use the --port (-p) option. See slc pm-install for details.

Icon

When installing, you can use command options to:

Ubuntu

On Ubuntu 12.04, 12.10, 13.04, 13.10, 14.04, or 14.10, use the sl-pm-install command with no options to install Process Manager as an Upstart 1.4 service:

Then run the service with:

Icon

If an application fails to deploy, or you encounter any other problems, see the log file /var/log/upstart/strong-pm.log to diagnose the issue.

RHEL 7+, Ubuntu 15.04 or 15.10

On RHEL 7+/CentOS, Ubuntu 15.04 - .10, and other distributions that support systemd, use this command to install Process Manager as a systemd service:

Then start the service with:

Icon

On RHEL, by default /usr/local/bin is not on the path so if you encounter problems running sl-pm-install, use this command:

If an application fails to deploy, or you encounter any other problems, see the log file /var/log/upstart/strong-pm.log to diagnose the issue.

RHEL Linux 5 and 6, Ubuntu 10.04-.10, 11.04-.10

For RHEL 5 and 6 and other distributions that don't support Upstart 1.4, use this command to install Process Manager as an Upstart 0.6 service:

Then run the service with:

Set up HTTP authentication

To secure StrongLoop Process Manager with HTTP authentication, use the --http-auth <credentials> option to the sl-pm-install command; for example for username "admin" and password "foobar":

This will enable HTTP basic authentication, and require the specified credentials for every request sent to the StrongLoop PM REST API.  

For more information, see Securing Process Manager.

Enable monitoring

To enable monitoring of application metrics, add the --metrics option:

Where <url> specifies the metrics collection URL (StatsD, Graphite, Splunk, log file, or syslog).  See Monitoring with slc for more information.

Enable Dockerizing apps

Icon

Prerequisite: You must have already installed and run Docker. For more information, see Docker documentation.

To install StrongLoop PM so that it automatically converts deployed applications into Docker images and installs them in the Docker Engine running on your deployment system, use this command:

For more information, see Deploying apps to Docker.

Set environment variables

To set one or more environment variables when you install StrongLoop PM as a service, use the --set-env option for example:

Install and run using Docker

Icon

Prerequisite: You must have already installed and run Docker. For more information, see Docker documentation.

If you want to set up HTTP authentication or enable monitoring application metrics, you must install with a slightly different command. See the relevant sections below.

Run the script below to download the image, start a StrongLoop PM container, and create an Upstart or systemd config file. The app will use port 3000; StrongLoop PM will use port 8701 and will automatically restart if your server reboots.

For more information on Docker and Docker Hub, see https://www.docker.com.

Set up HTTP authentication

To set up HTTP authentication with Docker, set the STRONGLOOP_PM_HTTP_AUTH environment variable to your username and password when you install:

For more information, see Securing Process Manager.

Enable monitoring

To enable monitoring of application metrics, set the STRONGLOOP_METRICS environment variable:

Where <url> specifies the metrics collection URL (StatsD, Graphite, Splunk, log file, or syslog).  See Monitoring with slc for more information.

Check Process Manager status

To check to see the status of the Process Manager service, use the status command: the exact syntax depends on the type of service (Upstart or Systemd).

For Upstart systems, use this command:

You'll see output like this:

For Systemd systems, use this command:

You'll see output like this:

Logging

With Upstart 0.6, logs go to syslog so that syslog can handle log rotation, which means you have to configure syslog to redirect log entries if you want them rotated.

 
With Upstart 1.4, log rotation and direction is handled by Upstart itself and logs are saved to /var/log/upstart/strong-pm.log.

Everything run under systemd is logged to journald, which is accessible through the journalctl command. See the journalctl man page for more information about journalctl. For convenience, StrongLoop systemd service definitions also log to syslog.

Upgrade Process Manager

To upgrade Process Manager, first reinstall from npm with:

Then reinstall the Process Manager service: 

Then reload the configuration.

For Upstart, use these commands:

For Systemd, use these commands:

 

Setting up a load balancer

Using an Nginx load balancer is optional. StrongLoop integrates with Nginx and provides an Nginx Controller via CLI and Arc. You can use your own load balancer or none at all, but in that case you are responsible for routing traffic to your hosts appropriately.

See Configuring Nginx load balancer for more information.