Deployment is almost by definition, remote. You don’t “deploy” on your workstation. And while you can
ssh into your production systems, and manually setup and run applications, that is a pretty low tech way of deploying. It might work with one host, but as you scale out to multiple production hosts, it will feel increasingly tedious, and worse, its not reproducible.
Despite that, there are good reasons for running deployment tools on a workstation:
- testing that the tools work
- exploring their capabilities
- reproducing problems seen in production in a safe-to-modify environment
In this blog I am going to show you how to quickly test your Node.js deployments locally using the new StrongLoop Process Manager.
What is StrongLoop Process Manager? It’s an enterprise-grade production runtime process manager for Node.js. StrongLoop Process Manager is built to handle both the vertical and horizontal scaling of your Node applications with ease.
It’s possible to install strong-pm onto your system or to just run it from the command line and deploy an app to it. For example:
slc pm & slc build; slc deploy, but that’s a bit clunky.
There is now a quick-start command for running an app in the StrongLoop Process Manager,
You can start an app simply:
$ cd my-app
$ slc start
App `.` started under local process manager.
View the status: slc ctl status
View the logs: slc ctl log-dump
More options: slc ctl -h
$ slc ctl status
worker count: 4
: cluster id 1, pid 5471
: cluster id 2, pid 5481
: cluster id 3, pid 5487
: cluster id 4, pid 5493
Note that this is different from a normal deploy: deployment is the pushing of a pre-built application package to a remote host,
slc start will start a local process manager for your user (in the background), and run your application in-place, from the directory it is on disk. This means you can live-update it. Note that while templates for example, might be loaded from disk on every request in
dev mode, you probably have to restart your workers for code updates to take effect:
$ slc ctl restart
You can also interact with your running application using the StrongLoop Arc graphical interface:
$ slc arc
You could also profile the local application, for example, by going to the Profile tab in StrongLoop Arc, selecting
localhost as the
8701 as the
Enjoy exploring your app running locally “as if” it was in production, and check out http://strong-pm.io/REMOTE for how to manage and deploy your applications in production.
Watch the demo! Check out this short video that gives you an overview of the StrongLoop Process Manager.
Sign up for the webinar! “Best Practices for Deploying Node.js Applications in Production” on April 16 with StrongLoop and Node core developer Sam Roberts.
In the coming weeks, look for more enhancements to the StrongLoop Process Manager and its runtime capabilities. But for now, here’s a few additional technical articles that dive into greater detail on how to make the most of this release:
- Best Practices for Deploying Node in Production
- How to Test Node.js Deployments Locally Using StrongLoop Process Manager
- How to Run StrongLoop Process Manager in Production
- How to Secure StrongLoop Process Manager with SSH
- Best Practices for Deploying Express Apps with StrongLoop Process Manager
- How to Create and Run StrongLoop Process Manager Docker Images