by moondev · 10y ago · 0 comments
Some random user with some edge case will put one of your nodes for your service into a bad state. Throwing away the machine will just lose the state and push the user somewhere else.
Also centralized log and metrics stores get real big and expensive really fast. Sometimes you simply can't afford to ship everything to it. So you'll find yourself putting detailed debug logs on the "free" ephemeral/local disks while info logs go to your central store.
If not, well congratulations, but if I got told I can't get the above to debug things I'd start question why this "pet" infrastructure lacks basic debugging ability.
What if the bug is corrupting data or sending incorrect results to the client? Even if you detect and kill the instance, you still have a problem to fix. And even if you can cleanly kill the instance and redirect the request, you can't avoid the latency hit from having to re-process it.
You can also spin up a canary machine to "live" debug.
You can reproduce the code and data, but how can you reproduce the exact state? You can't log everything that happens in a machine.
PS: How is your automated provisioning system reaching your cluster if not by SSH?
Saltstack is either using SSH to communicate or opening it's own port. I'd much rather trust an open ssh port for securely provisioning/management than allow any other piece of software to keep a port open (upto and including TLS based protocols).
This allows me to have one central server that is well secured and protected that allows ingress from the remote hosts, and then all the clients reach out to the master to get their tasks.
I build machine images with packer that get provisioned during the deployment pipeline. That single machine is then put into a cluster with x number of copies. If one dies I don't care, the cluster provisions another automatically.
Not sure about moondev, but Terraform + Cloud-init + Container Orchestrator means that I basically never need to SSH into my nodes, except in extreme/rare circumstances.
So you do need ssh after all?
I guess that's an offensive thing to point out judging by my score...
A) A hardware issue (thus requiring hardware maintenance)
B) A software issue triggered by the particular workload of this machine (thus requiring a software change)
C) A network issue (thus requiring network maintenance, possibly phone calls to ISPs, etc)
D) Something else (thus requiring who knows what)
The most normal way in the real world is, have a sysadmin and a dev sit down together, SSH into the machine, and poke things until they arrive at the root of the problem (possibly with additional process involved if it's a really big system).
Then, through normal (non SSH) processes, perform the required maintenance and update your monitoring system so that it identifies problems of that class.
When you have 100 machines, you can probably afford to do this. It would be silly, because when you only have 100 machines, most of your problems will be software or network issues. Still, you can do it and it probably won't cost you a kidney. When you have ten thousand, you can't.
And this is even assuming that your monitoring system notices the problem. All too frequently, you'll notice the problem in some other way. Monitoring systems are designed to detect the things you knew might happen, and problems similar to those. There will be blind spots, it's just unavoidable.
We aren't talking about using SSH to go in and fix a machine so things stay up. It's about figuring out why something is happening.
So not all of the nodes can be immutable and stateless.
With real, physical machines; you could have a cooling issue (which you should fix), a manufacturing defect (which you should RMA), a networking issue (which you should fix). All of these can easily be unique to an instance, and all of them need analytical attention; especially when you're paying for all of those machines "horizontally" and "at scale".
https://news.ycombinator.com/item?id=11746425 https://news.ycombinator.com/item?id=12482212