Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
HOW TO DEPLOY NODEwithout getting fired
@seanhessseanhess.github.com
Try it yourself      deploynode.tk           user public           pass publicssh public@deploynode.tk
WHO  AREYOU?
from FIRST STEPS    to MISSTEPS          toSCALE
Ratinatorlywho RATES the RATE-MEN?
SALARY is for chumps100,000shares of sweat-equity
you decide to try
Your First Node“but my brother saysthat .NET is the best      language”
var express = require(express)var app = express.createServer()app.get(/, function(req, res) {    res.send("Hello World!")}...
your app is aLONG RUNNINGPROCESSit handles all the requests                  ...if it’s on
the PROTOTYPE       ONLINE must be“Sequoia is going to LOVE this”
SHARED HOSTING FAIL *you need to run a    PROGRAM
VPS         WIN!  like a cheapDEDICATED SERVER
sudo make me a server        okay...
> ssh root@ratinator.lyroot@ratinatorlys password:Welcome to Ubuntu 11.04 (GNU/Linux# adduser node# adduser node sudo#   s...
MAKE IT GO•copy our code• node app.js
DON’T CLOSE   the       LID!!“I didn’t do anything... Check         Energy Saver”
your app   BELONGS         to your   ssh sessionLOG OUT     ==   DIE
SCREEN you    keeps  LOGGED IN
Undo! Rollback!“I know enough HTML to be       dangerous”
let’s addVERSION CONTROL      use GIT to deploy
manage yourDEPENDENCIES package.json               > npm install
a PROCESS emerges• git commit and push• log in to server• pull• npm install• restart
LAUNCH!“I’ve got Techcrunch right where I            want them”
port 80•   must run as root
This is where I stop trying   to design my slides
It keeps DYING!  “Maybe we should trywindows servers instead”
upstart•   OS will start on boot•   Respawn
monitoring•   know if it goes down
It works for me!or, when the cracks first     began to show...
logging•   keep your output
uncaughtExceptionprocess.on(“uncaughtException”,  function(err) {     console.log(err.message)})
Don’t forget step 6!“Will you put my changes       up for me?”
complicated deploy•   it can get easy to miss a step
automated•   keep the knowledge in your code    base•   put extra stuff in package.json    “install”
Too Slow!“Let’s just throw more    money at this"
Multiple Processes•   cluster up to your cores
Varnish Cache       •  avoid repeating work       • set headers and gosudo   apt-get install varnishsudo   vim /etc/defaul...
Staging Box
cheat with Heroku•   it’s easy, but can be expensive
Scale“We should aim for... 100     million users”
Multiple Servers• more app servers• varnish and db on separate box• use node-control to deploy• smart db = good for a long...
automate                  rem                     emwith                      erb UPSTARTand GITor CHEATwith   HEROKU
seanhess.github.com         @seanhess
> npm install express...> lsapp.js        node_modules> node app.jsListening on 3333
How to deploy node to production
How to deploy node to production
How to deploy node to production
How to deploy node to production
How to deploy node to production
Upcoming SlideShare
Loading in …5
×

How to deploy node to production

16,405 views

Published on

Published in: Technology
  • I love this.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • where's the beef?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • node를 통해서 배포하는 과정을 보니 매우 스마트하게 처리되는것을 볼 수 있다. 역시 초기 아키텍처 과정에서 부터 scale을 고려해서 접근한다면 손쉽게 확장 가능한 웹서비스 구현이 가능하다는 얘기
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

How to deploy node to production

  1. 1. HOW TO DEPLOY NODEwithout getting fired
  2. 2. @seanhessseanhess.github.com
  3. 3. Try it yourself deploynode.tk user public pass publicssh public@deploynode.tk
  4. 4. WHO AREYOU?
  5. 5. from FIRST STEPS to MISSTEPS toSCALE
  6. 6. Ratinatorlywho RATES the RATE-MEN?
  7. 7. SALARY is for chumps100,000shares of sweat-equity
  8. 8. you decide to try
  9. 9. Your First Node“but my brother saysthat .NET is the best language”
  10. 10. var express = require(express)var app = express.createServer()app.get(/, function(req, res) { res.send("Hello World!")})app.listen(3333)console.log("Listening on 3333")
  11. 11. your app is aLONG RUNNINGPROCESSit handles all the requests ...if it’s on
  12. 12. the PROTOTYPE ONLINE must be“Sequoia is going to LOVE this”
  13. 13. SHARED HOSTING FAIL *you need to run a PROGRAM
  14. 14. VPS WIN! like a cheapDEDICATED SERVER
  15. 15. sudo make me a server okay...
  16. 16. > ssh root@ratinator.lyroot@ratinatorlys password:Welcome to Ubuntu 11.04 (GNU/Linux# adduser node# adduser node sudo# sudo apt-get install python-software-properties# sudo apt-add-repository ppa:chris-lea/node.js# sudo apt-get update# sudo apt-get install nodejs npm
  17. 17. MAKE IT GO•copy our code• node app.js
  18. 18. DON’T CLOSE the LID!!“I didn’t do anything... Check Energy Saver”
  19. 19. your app BELONGS to your ssh sessionLOG OUT == DIE
  20. 20. SCREEN you keeps LOGGED IN
  21. 21. Undo! Rollback!“I know enough HTML to be dangerous”
  22. 22. let’s addVERSION CONTROL use GIT to deploy
  23. 23. manage yourDEPENDENCIES package.json > npm install
  24. 24. a PROCESS emerges• git commit and push• log in to server• pull• npm install• restart
  25. 25. LAUNCH!“I’ve got Techcrunch right where I want them”
  26. 26. port 80• must run as root
  27. 27. This is where I stop trying to design my slides
  28. 28. It keeps DYING! “Maybe we should trywindows servers instead”
  29. 29. upstart• OS will start on boot• Respawn
  30. 30. monitoring• know if it goes down
  31. 31. It works for me!or, when the cracks first began to show...
  32. 32. logging• keep your output
  33. 33. uncaughtExceptionprocess.on(“uncaughtException”, function(err) { console.log(err.message)})
  34. 34. Don’t forget step 6!“Will you put my changes up for me?”
  35. 35. complicated deploy• it can get easy to miss a step
  36. 36. automated• keep the knowledge in your code base• put extra stuff in package.json “install”
  37. 37. Too Slow!“Let’s just throw more money at this"
  38. 38. Multiple Processes• cluster up to your cores
  39. 39. Varnish Cache • avoid repeating work • set headers and gosudo apt-get install varnishsudo vim /etc/default/varnish # port 80sudo vim /etc/varnish/default.vcl # point to our app at port 3333sudo /etc/init.d/varnish start
  40. 40. Staging Box
  41. 41. cheat with Heroku• it’s easy, but can be expensive
  42. 42. Scale“We should aim for... 100 million users”
  43. 43. Multiple Servers• more app servers• varnish and db on separate box• use node-control to deploy• smart db = good for a long time
  44. 44. automate rem emwith erb UPSTARTand GITor CHEATwith HEROKU
  45. 45. seanhess.github.com @seanhess
  46. 46. > npm install express...> lsapp.js node_modules> node app.jsListening on 3333

×