Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor Application - How might one implement orchestration/provisioning for multi-instance deployments?

I have a meteor.js application that works well as a single instance deployment but now I want to setup the infrastructure to enable and automate the creation of more instances (1 for each client).

I intend to have a subdomain for each deployment that is reserved for a given client.

I image I have to have to:

  1. Retrieve the desired subdomain for each client (through some sign-up site)
  2. Bundle the application
  3. Deploy an instance on a separate port with a separate DB for each
  4. Setup a reverse proxy to forward the subdomain to the appropriate internal port
  5. Setup something to monitor the processes and restart them if they crash or a reboot occurs
  6. Automate re-bundling and deploying to all instances when the application code is updated and released

To the best of my understanding I think the appropriate tools for this job are in the orchestration family (Capistrano, Fabric, Func, Rundeck) but I don't understand what pieces they take care of and what pieces are/should be left to other tools.

A lot of my problems come from not knowing how to connect the steps and/or if they should be connected. Others come from not knowing what best practices are or where the design patterns around doing this sort of stuff can be learned.

For example:

  • I know how to bundle the application on the command line but should that step be part of a shell script, or python script, or ruby.... same goes for step 2 in deployment (I know how to do it on the command line but not how to automate it)
  • I imagine I could setup a reverse proxy but I don't know what reverse proxy tool out there can be dynamically modified or configured and what if any scripting language would be good for doing that dynamic configuration.
  • I have no idea what considerations need to be made or should be made when updating/redeploying the apps.

Basically it seems like there are a number of tools out there and quite a few ways to do this stuff but very little guidance on what tools work well together or how to do it properly. I would be highly motivated to learn the necessary tools and languages if I didn't feeling like selecting a set of tools that work well together was effectively a dice roll.

like image 978
funkyeah Avatar asked May 01 '26 15:05

funkyeah


1 Answers

you could start with meteor-up to make your servers run all the time (npm forever) and at startup.

haproxy has a soft-reconfiguration feature that allows to add and remove subdomains (or servers for a sub-domain) without restarting the service.

you should have everything you need to get going.

like image 97
Micha Roon Avatar answered May 03 '26 05:05

Micha Roon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!