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












