Wednesday, 15 July 2015

Node.js express application production deployment -


Say I have a nodes + express + mangodb web application and now I am using an ABS EC2 machine A Linux distribution (I'm using Ubuntu Server 14.04, would you use something different?)

Generally, instead of using the environment on the environment, a single tier has a decent production environment What are the basic steps to make?

Do you have an HTTP server (nginx, apache, ..)? What will be the firewall configuration? What else would you consider before becoming public (nodes and express configurations, etc ..)? Which device would you use (i.e. forever)? Which other system configuration would you consider?

The focus of this question is not on display, consider the high level of machine load and app scaling.

I have implemented a production environment for many business applications on AWS, recently node / express / Mongo is used. Through a lot of testing, trial and error and some scripting which I work for me is settled on a configuration.

Below is a summary of the services / utilities used by I. Design, everything is widely available and is well documented so that you have a problem discussing about configuring each of your specific needs Should not be.

AWS Services

    EC2 Security Group : Primary firewall
  • ELB / Autoscaler (optional) : Load Balance; Add / remove instances based on load;
  • CloudWatch : Monitor instance availability
  • SNS : Cloudwatch Specify notification methods for alarms (e-mail / sms)

OS / utilities

  • < Em> Ubuntu : The most recent LTS version, currently 14.04; Cron / apt-get
  • is configured to weekly updated using nginx : reverse proxy for node process; 50x Error Handling; Service / public files; Enable SSL if not using ELB
  • upstart : Start / stop app for maintenance; Respawn app if it crashes (forever ala); Start the app on reboot
  • Monit : Monitor node process for extended outages (handles upstream respawn failure); File system monitoring free space; Mongo Mogo Process

I use standard apt-mill versions of node, XP, and NPM, in which there are no special config settings, to deploy updates of the I app, I A cron script is written which checks the Zithub branch, so that the branch is automatically triggered by releasing a new version.

Surely there are many more options and these are not necessarily definite ones .... In other words, YMMV However, in my experience they are quite easy to configure, work reliably, things keep moving smoothly, and inform you quickly / when the problems arise that require your attention.


No comments:

Post a Comment