6. Meteor deploy
$ meteor deploy myapp.meteor.com
• Part of the core
• Running on Meteor's infrastructure
• The easiest way to deploy your application is to use meteor
• Your application is now available at myapp.meteor.com
Client
[Meteor]
Server
meteor.com
7. Meteor deploy
• Galaxy (from trello)
This is MDG's commercial product -- a managed
cloud platform for deploying Meteor apps. You
have control of the underlying hardware (you
own the servers or the EC2 instances, and
Galaxy manages them for you).
General Availability for Galaxy will be sometime
after 1.0, since we want to focus on Meteor 1.0
and get it out as quickly as possible.
9. Meteor build
$ meteor build my_directory
• Part of the meteor core
• Running on your own infrastructure
• Generates a fully-contained Node.js application in the form of a tarball
Client
[Meteor]
Server
[Node.js
+ deps]
(bundle).
• Used also for generating mobile versions (android/ios)
• Starts the app with: node main.js
• Still not documented in docs.meteor.com
10. Meteor build – still some deps are
missing...
• But if you’ve used a binary npm module, you
need to re-install it manually. Just like you are
doing it with fibers.
• Actually things are changing from version
>0.9
But If you are using demeteorizer, then there is
no problem.
12. demeteorizer
• Installs via NPM
• Demeteorizer's output is similar to meteor
build except that it generates a package.json
containing all required dependencies. This
allows you to easily run npm install on the
destination server, which is especially
important for compiled modules.
• Adds package.json
• Installs with npm install -g demeteorizer
13. demeteorizer
$ meteor build my_directory
• Running on your own infrastructure
• Generates a fully-contained Node.js application in the form of a tarball
Client
[Meteor]
Server
[Node.js]
(bundle)
• Starts the app with: node main.js
14. Demeteorizer – modulus
• Opensourced by Modulus
• Modulus is a PaaS that officially support
Meteor
• Intregrated into CLI moduls deploy
15. Modulus – how it works
B
A
L
A
N
C
E
R
servo
1
servo
2
servo
3
http req
17. MUP
• Installs via NPM
• Developed by Arunoda
• Single command server setup
• Single command deployment
• Autostarts app (upstart and forever)
• Access, logs from the terminal (supports log tailing)
• Support for multiple meteor deployments
Client
[Meteor]
Server
[ubuntu/debian
opensolaris]
18. Mup – why is cool
• Deploys on AWS EC2
• Rebuilds platform dependent NPM modules
• Uses JSON for muliple deployment paths (can
manipulate them via gruntjs)
• Supports meteor.settings
• Env vars are in json
19. How I launched my project on line
• problem
– We want to serve many users, from everyware
– We want to scale easy
– Backgrounds and heavy loads are moved outside
meteor.
• solution
– Platform: AWS + compose.io
– Deployment: gruntjs + mup
21. tips
• Use MongoDb with OpLog
– Compose is a good start
• Don’t serve static content via nodejs
• Use balancer that supports
– Sticky session when websockets not work.
– Leastconn algorithm
– Client timeouts > 30 sec
22. Haproxy.conf
defaults
mode http
timeout connect 60s
timeout server 60s
timeout client 60s
timeout check 5s
frontend public
#binding port 80
bind *:80
default_backend apps
backend apps
#load balancing algorithm
balance leastconn
#using JSESSIONID as the cookie
cookie JSESSIONID insert nocache
#adding server
server host1 host1.example.com cookie host1
server host2 host2.example.com cookie host2
server host3 host3.example.com cookie host3
#Link: https://meteorhacks.com/how-to-scale-meteor.html
23. deployment
• Use Gruntjs for your deployment steps
– Create a .deploy folder in your meteor proj
– Run tests, before deployment
– Compile Scss to css
– Upload statics to CDN (S3)
– Add private local npm modules
– Edit MUP json conf files before deploying
• And finally, use mup for the upload
24. deployment
..and make sure your deployments to Test and
Production enviroments requires minimum
manual operations...