Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know this is going to sound ridiculous and maybe this is the wrong topic. I'm at a spot where I wish there was a closer to turn key framework for my project.

I wrote 3 interdependent web servers, have them running on all the same virtual machine on digital ocean with varnish. Now I need to upgrade ubuntu and I don't want them to go down. So, apparently I need at least 3 machines if not more. One to run varnish or something similar, to direct to the other 2. Some way to bleed people over to one of the 2 machines. Once everyone is on one machine I can upgrade the unused machine. After that I can bleed them all back and then upgrade the other.

Is this too small a niche? Is the answer I should have used "google cloud"? It just seems like each step is so much work. I certainly learned a lot (vagrant, ansible, and other stuff) although all of that knowledge will be probably obsolete before I need to do this again.

Is there something I should have looked at? Sandstorm seems one level down. Like it's more like a replacement for the old lamp/cpanel isps.



In your scenario, you need "just" two machines - and really only one running most of the time. You have varnish+appservers running one one vm now. What you need is one more vm, running the same stack. Depending on how you handle sessions this could be as easy as:

    0: reduce ttl of dns to ~60s
    1: bring up vm2==vm1
    2: upgrade vm2
    2.1: test vm2
    2.2: shutdown vm2, take DO snapshot
    2.3: instanciate vm/droplet of vm2
    3: point/change dns from vm1 to vm2
    4: wait for traffic to die on vm1
    5: shutdown vm1
    6: possibly increase ttl in dns again
Next round, same procedure. This is not ready for HA -- easiest way there is running 2 vms like now, but with haproxy in front (so the vm has ha-varnish-3appservers), along with heart-beat and a shared ip. I don't thing DO supports that -- and it is probably not worth the hassle if you can live with dns changeover-time==downtime (say, minutes modulus wrongly configured dns caches).

With a couple of dedicated ips, you can usually get away with vm2 taking vm1s ip (and vice-versa) -- but again that depends on your session set-up and/or if dropping sessions are ok. With sessions in some kind of replicated cache/db (eg: redis, mysql) -- you could probably set vm2 to slave over/replicate sessions, then do the dns [ed: or ip] switch[over].


this is all great. thanks!!

My real point was why isn't this a finished product yet kind of like Sandstorm? Basically why hasn't someone made a system that just handles this for me. I start n services, when I want to upgrade something it provides a simple UI or a couple of command line options to just do it. Why is it all done by hand?

It seems like enough devs might need this now-a-days.

Note: I get why. I guess my point is there's an opportunity here and Sandstorm made me think of it.


There is. It's called a PaaS. You write the app, the PaaS providers handles the rest.


I'm using Docker + Fig. The nice thing is that you can exactly replicate your production environment on your local machine and the Dockerfile syntax is really simple. The not so nice thing is that there's no "simple" way to run docker containers on multiple physical/virtual machines right now (that should become easier once Docker team releases their cluster solution). It would be nice to have a fig registry where people can publish complete Docker based systems (e.g. varnish + nginx + Node.js server) but I don't think there is such thing available at the moment. I wrote a bit about that idea here: http://syskall.com/crazy-and-not-so-crazy-startup-ideas-2015...

Also, I asked a similar question on HN one month ago and got some interesting replies: https://news.ycombinator.com/item?id=8805952


Heroku might be an option (in the future).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: