Meteor Up - Meteor deployment tool
λ―Έν°μ΄λ₯Ό μ¬μ©νλ©΄μ κ°μ₯ λΆνΈνλ κ²μ΄ μλ²μ λνλ‘μ΄ νλκ²μ΄ νλ€λ€λ κ²μ΄μλ€. λ°©λ²λ€μ μ¬λ¬κ°μ§κ° μμ§λ§(λ¬Όλ‘ λ΄ λΈλ‘κ·Έμλ μλ€) κ·Έμ€μ νλλ λ¬Όλ‘ νλμ ν΄μ μ¬μ©νλ κ²μ΄μλ€.
μ΄ κΈμμλ Meteor up μ λν΄μ μ€λͺ νλ€.
Meteor upμ νΉμ§μ μ€μ νμΌ νλλ§ λ§λ€μ΄λ nodejs, mongoDB, PhantomJS λ±μ dependencyλ€μ μ€μΉν΄μ€λΏλ§ μλλΌ mup deployλΌλ κ°λ ₯ν λͺ λ Ήμ΄ νλλ‘ μλ²μ λνλ‘μ΄ν μ μλ€ λν mup start, stop, restart λͺ λ Ήμ΄λ₯Ό ν΅ν΄ μμ½κ² μ±μ μΌκ³ λμ μλ€
νμ¬ μ§ννλ μλ²λ https://www.digitalocean.comμμ μλΉμ€λλ Ubuntu 14.04μ΄κ³ nodejs v0.12.0, npm μ΄ μ€μΉλμ΄ μλ€.
Meteor μ€μΉ
curl https://install.meteor.com/ | sh
λ―Έν°μ΄μ μ’μμ μ€μ νλλ μ΄ κ°λ¨ν μ€μΉ μ½λλΌκ³ μκ°νλ€ :)
nginx μ€μΉ
sudo apt-get install nginx
- ngnix μ€μ
cd /etc/nginx/sites-available/ sudo vi custom
- /etc/nginx/sites-available/custom
server { listen *:80; server_name mycustomappname.com; access_log /var/log/nginx/app.dev.access.log; error_log /var/log/nginx/app.dev.error.log; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header X-Forwarded-For $remote_addr; } }
- Create a Symbolic Link for custom
ln -s /etc/nginx/sites-available/custom /etc/nginx/sites-enabled/custom
- default μμ
rm /etc/nginx/sites-enabled/default
-- λ§μ½μ μν΄ ν μ€νΈ!
nginx -t
- Restart nginx
sudo service nginx restart
ipλ‘ μ μνμλ μ΄μ κ°μ΄ λ¬λ€λ©΄ μ±κ³΅!
Meteor up μ€μΉ
sudo npm install -g mup
Create a New Meteor Project
meteor create myApp cd myApp
Setup Meteor up
- Initialize mup
mup init vi mup.json
μμ μ μ λ§μ λ§κ² μ€μ μ λ°κΏμ€λ€
{ // Server authentication info "servers": [ { "host": "my-ip-address", "username": "root", "password": "password" // or pem file (ssh based authentication) //"pem": "~/.ssh/id_rsa" } ], // Install MongoDB in the server, does not destroy local MongoDB on future setup "setupMongo": true, // WARNING: Node.js is required! Only skip if you already have Node.js installed on server. "setupNode": false, // WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number. "nodeVersion": "0.12.0", // Install PhantomJS in the server "setupPhantom": true, // Application name (No spaces) "appName": "myApp", // Location of app (local directory) "app": ".", // Configure environment "env": { "PORT": "3000", // The port you want to bind to on your server. "UPSTART_UID": "meteoruser", // The user you want to run meteor as. "ROOT_URL": "http://mycustomappname.com" }, // Meteor Up checks if the app comes online just after the deployment // before mup checks that, it will wait for no. of seconds configured below "deployCheckWaitTime": 15 }
- Setup mup
sudo visudo
μλμ μ€μ %sudo ALL=(ALL) ALL μ΄λ κ² μμ νλ€ %sudo ALL=(ALL) NOPASSWD:ALL
sshpass μ€μΉ
sudo apt-get install sshpass sudo apt-get update
mup setup
mup setup
μ¬κΈ°μλΆν΄ μκ°μ΄ μ€λ걸리λ―λ‘ λ΄μ§μ νλλ‘ νμ :)
μμ κ°μ΄ λμλ€λ©΄ μμ£Ό μ±κ³΅! μλλΌλ©΄ μ²μλΆν° λ€μ...
Deploy!!!
mup deploy
μμ μ urlλ‘ μ μν΄λ³΄λ©΄...
μμ μ μλ²λ₯Ό κ°λλ€λ건 μ λ§ νλ μΌμ΄λ€. μ²μ μ€μ μ snapshotμ μ°μ΄λκ³ (snapshotμ΄λ μ½κ² λ§νλ©΄ μλ² λ°±μ μ΄λΌκ³ μκ°νλ©΄ λλ€.) μ€ν¨νλ©΄ λ€μ κ·Έ snapshotμ restoreν΄μ λ€μ μΈν ν΄λ³΄κ³ νλ μμ μ λ°λ³΅νλ€λ³΄λ©΄ μ΄λμ λ€λ₯Έ λΈλ‘κ·Έμμ λ°λΌνλ μ½λλ€μ μ΄ν΄νκ² λλ€.
λ΄κ° μ¬μ©νλ μλ²λ Digitaloceanμμ μ 곡νλ μλ²μΈλ° μ±κ°ν΄λ‘ μμΉλ₯Ό μ€μ νλ©΄ κ·Έλ κ² λ리μ§λ μκ³ μλλ λΉ¨λΌ μΈλ§νλ€.
μλ κ²½λ‘λ‘ λ€μ΄κ°λ©΄ digitalocean 10λ¬λ¬ μΏ ν°μ μ»μ μ μμΌλ―λ‘ λ¬΄λ£λ‘ μ¬μ©ν΄λ³΄λλ‘ νμ
https://www.digitalocean.com












