4

I have two servers, each running anywhere from 50-100 different legacy webapps, written in languages ranging from PHP to Python to Ruby-on-rails to NodeJS.

We're wanting to kill off these machines as they're old, insecure and badly organised, have no consistent configuration logic, and are also running two instances of mysqld each (don't ask).

To that end, I want to do the following:

  • Delete any now-depreciated legacy projects
  • Sandbox each app somehow, possibly into its own Docker or Passenger container
  • Create the new servers as an auto-scaling stateless cluster, moving each MySQL database to its own RDS instance
  • Possibly even be able to auto-scale inactive apps in a manner similar to how Heroku does

Ultimately, I'm wanting to do something similar to what Deis or Flynn do, though neither of those is production-ready at the moment.

I'm honestly a bit overwhelmed by it all and am really not sure where to start. Any suggestions? Is Passenger something I should even be considering? Docker?

Thank you!

aendra
  • 177
  • 9
  • there is no easy easy way to autoscale where it just works. It requires a lot of backend development to get there. Like for example where I work we utilize docker a lot and we use metrics in graphite to tell if we need to spin up more docker containers. There is no silver bullet here – Mike Sep 05 '14 at 12:20
  • @Mike: Valid point; but having the ability to set thresholds (similar to how AWS' Elastic Beanstalk platform does things) would be helpful. – aendra Sep 05 '14 at 13:34
  • that's where we use graphite and hook into it.. i'm not sure of anything out there that is out of the box like beanstalk is – Mike Sep 06 '14 at 02:18

1 Answers1

5

I'm not quite sure what your actual questions are. Your overall question is fairly vague. You have three main questions here from what I can gather:

  1. Where should I start to get my own scalable PaaS infrastructure?
  2. Is Passenger something I should even be considering?
  3. Is Docker something I should be considering?

I'll answer number 3 first since that is easiest. The answer is Yes. If your going to be building something new, Docker will help get you into a more portable world, which will in turn help get you to a more scalable point. Your legacy webapps would run as their own containers, with their own sets of dependencies, and thus, become more portable.

The answer to number 2 sounds more dependent on Ruby and the Ruby applications in general. Can you run Passenger? Maybe... This seems more dependent on how the application was written and what servers it might be compatible with. However, it does appear that Phusion is making strides to be very Docker friendly. The have Docker images specifically around running Ruby, Python, and Node.js applications at least - https://github.com/phusion/passenger-docker.

My answer to number 1 would be to start by containerizing legacy applications. Make the applications more twelve factor compliant (http://12factor.net/) if they are not already. Make them more service oriented. Instead of running stuff like MySQL, Redis, Apache, PHP-FPM, etc in one container, separate them out into different services that connect to each other over TCP and HTTP (Docker links would be a great place to start with this - https://docs.docker.com/userguide/dockerlinks/).

By getting your applications to a point where they run in their own container, use external services that could run anywhere, and can be versioned with a default working configuration (a release), then you are getting closer to a world where you can then start writing scheduling, service discovery, and deployment scripting.

If you haven't already, check out stuff that comes a little earlier than a full-blown Docker PaaS such as https://coreos.com/ or http://www.projectatomic.io/. Something like these give you scheduling around your own containers / units rather than actually building your application containers for you. For learning in development, you might use something like http://www.fig.sh/ or http://decking.io/. Great for testing out your new service oriented containers locally.

For more tooling around Docker, keep an eye on https://stackoverflow.com/questions/18285212/how-to-scale-docker-containers-in-production. The top answer has a pretty good overview of what is currently out their and the author keeps it updated fairly well.

Andy Shinn
  • 4,131
  • 8
  • 38
  • 55
  • Apologies for the breadth of the question, in retrospect I could've separated it into multiples. That said, you answered it really well! Will leave open for a few more days but will accept if nobody else has anything else! – aendra Sep 10 '14 at 11:12