I wasn't even aware -- Arch has been super stable for me once I set it up (and setting it up actually kind of forces a deeper understanding than most other distros).
I've been recklessly running pacman -Syu for years without even knowing the pacman tool super deeply (I always have to look up pacman -Qs in the manual) and have had relatively little trouble
When pacman removes a package that has a configuration file, it normally creates a backup copy of that config file and appends .pacsave to the name of the file. Likewise, when pacman upgrades a package which includes a new config file created by the maintainer differing from the currently installed file, it saves a .pacnew file with the new configuration. pacman provides notice when these files are written.
When .pacnew files are created, typically you check the difference between the unchanged-currently-using-version with the pacnew version. The pacdiff tool helps with this.
It's not as unstable as people think. I have three raspberry pi servers running arch, and besides the one on a shifty internet connection that's only available over VPN for a reason out of my control, they have all been exceptionally stable.
My laptop runs on Arch. It's not unstable per-se, although I have had a few issues after upgrades. My personal server runs Ubuntu 16.04 LTS, which I'm far more comfortable with. It gets security updates, but runs older software that is security tested more. It just makes me more comfortable that the server is secure, even if I don't update straight away.
Interesting read, great job on recovering the server. My only nagging thought while reading the whole thing was: Surely just getting the box config into ansible or similar would have skipped the entire thing. Investing in build tools has allowed me to basically forget systems administration for anything other than my personal desktop. When a box is bad I just torch it and rebuild it.
This box does hold an embarassing amount of not yet backed-up state -- Nothing mission critical, but there are databases for projects that I don't have backed up anywhere except on the local disk, and to torch the box I'd need to snapshot the FS at the very least (I'm running ceph, so theoretically I could add another node, rebalance, then torch the one node).
I do use ansible, so I definitely understand the savings though (and I'm not sure if I noted it in the article, but I was actually playing with Kubernetes before the incident, another big piece of the servers-as-cattle puzzle) -- I'm just not sure it would have changed much if I had run the update (and fubar'd the boot) from an ansible script or myself. Ansible would have helped on the rebuild though, but technically if I had set up the box with ansible, and this problem happened, it'd happen over and over again until I decided NOT to do the update (then I'd be back to figuring it out and trying to debug it, maybe on a spare machine).
"torching a box and rebuilding" is definitely the goal though (rephrased, treating my servers as cattle and not pets), but I'm not quite there yet -- in particular the backup issue is my biggest worry. I think the system I've used that's gotten me the closest to this was CoreOS's Ignition. CoreOS had multiple partitions for upgrades, and would rollback automatically IIRC if an upgrade failed, and encouraged you to provision systems using Ignition and completely map out your system in YAML basically -- brilliiant as far as I'm concerned.
At the end of the day it seems like it's almost impossible for someone to truly run a group of servers as cattle and torch at will -- surely the DB/data cold-storage servers you'll have to be more careful with? How are people handling this?
Depends on your budget and performance requirements. You mention k8s: run your mysql as a container with a persistent volume claim backed by ceph.
Now you only care about the health of your ceph and k8s cluster, which is more than one machine, and you should be able to always drain at least one if it's bad and rebuild it. Now you need to have the discipline to only wreck one machine at a time, but it's a more manageable problem.
EDIT: Just to be clear as well, I really like your write-up. The world needs more of them. And carefully bringing a system back to life is a valuable skill, I just like not having to rely on it.
Hey it absolutely is! thanks for noting -- I was wondering where the hell the file was! I've used iptables restore and had to try and make sense of the output when debugging some issues with kube-router once, but I never learned enough about iptables since I've been using ufw to abstract it anywhere I could...
I think I'll make an effort to document and publish the weird problems I run into. I never really think about it since the problems seem so trivial (I've been doing this stuff since the 1990s), but just having it indexed and searchable online could help someone some day.
Yeah that was the hope -- I have a ton of blog posts in the pipeline but this one might actually help someone at some point, especially if what happened wasn't strictly just user error on my part!
Much better than finding a random forum thread where someone's like "nvm fixed it"
34 comments
A server... running arch...
Brave.
The arch web page runs on arch too
Well if it goes down they still have access to the Wiki to fix it all least
To be clear, all Arch infrastructure runs Arch.
https://git.archlinux.org/infrastructure.git/
I wasn't even aware -- Arch has been super stable for me once I set it up (and setting it up actually kind of forces a deeper understanding than most other distros).
I've been recklessly running
pacman -Syufor years without even knowing the pacman tool super deeply (I always have to look uppacman -Qsin the manual) and have had relatively little troubleYou shouldn't just use
pacman -Syuand do nothing else.This wiki page explains some nuances of pacman you should be aware of
When .pacnew files are created, typically you check the difference between the unchanged-currently-using-version with the pacnew version. The
pacdifftool helps with this.Maybe I'm an outlier then. I've had a couple of instances where it's failed to boot after an upgrade.
More importantly however is security. Bleeding edge software won't be as thoroughly tested as the software on Ubuntu/Debian ect.
My personal server runs on it as well
My Laptop runs Arch, my personal server runs Ubuntu LTS
It's not as unstable as people think. I have three raspberry pi servers running arch, and besides the one on a shifty internet connection that's only available over VPN for a reason out of my control, they have all been exceptionally stable.
My laptop runs on Arch. It's not unstable per-se, although I have had a few issues after upgrades. My personal server runs Ubuntu 16.04 LTS, which I'm far more comfortable with. It gets security updates, but runs older software that is security tested more. It just makes me more comfortable that the server is secure, even if I don't update straight away.
Interesting read, great job on recovering the server. My only nagging thought while reading the whole thing was: Surely just getting the box config into ansible or similar would have skipped the entire thing. Investing in build tools has allowed me to basically forget systems administration for anything other than my personal desktop. When a box is bad I just torch it and rebuild it.
This box does hold an embarassing amount of not yet backed-up state -- Nothing mission critical, but there are databases for projects that I don't have backed up anywhere except on the local disk, and to torch the box I'd need to snapshot the FS at the very least (I'm running ceph, so theoretically I could add another node, rebalance, then torch the one node).
I do use ansible, so I definitely understand the savings though (and I'm not sure if I noted it in the article, but I was actually playing with Kubernetes before the incident, another big piece of the servers-as-cattle puzzle) -- I'm just not sure it would have changed much if I had run the update (and fubar'd the boot) from an ansible script or myself. Ansible would have helped on the rebuild though, but technically if I had set up the box with ansible, and this problem happened, it'd happen over and over again until I decided NOT to do the update (then I'd be back to figuring it out and trying to debug it, maybe on a spare machine).
"torching a box and rebuilding" is definitely the goal though (rephrased, treating my servers as cattle and not pets), but I'm not quite there yet -- in particular the backup issue is my biggest worry. I think the system I've used that's gotten me the closest to this was CoreOS's Ignition. CoreOS had multiple partitions for upgrades, and would rollback automatically IIRC if an upgrade failed, and encouraged you to provision systems using Ignition and completely map out your system in YAML basically -- brilliiant as far as I'm concerned.
At the end of the day it seems like it's almost impossible for someone to truly run a group of servers as cattle and torch at will -- surely the DB/data cold-storage servers you'll have to be more careful with? How are people handling this?
Depends on your budget and performance requirements. You mention k8s: run your mysql as a container with a persistent volume claim backed by ceph.
Now you only care about the health of your ceph and k8s cluster, which is more than one machine, and you should be able to always drain at least one if it's bad and rebuild it. Now you need to have the discipline to only wreck one machine at a time, but it's a more manageable problem.
EDIT: Just to be clear as well, I really like your write-up. The world needs more of them. And carefully bringing a system back to life is a valuable skill, I just like not having to rely on it.
Hey man, if this is your article, just wanted to mention that iptables should have a config file at /etc/iptables/iptables.rules.
Hey it absolutely is! thanks for noting -- I was wondering where the hell the file was! I've used
iptables restoreand had to try and make sense of the output when debugging some issues withkube-routeronce, but I never learned enough about iptables since I've been usingufwto abstract it anywhere I could...I'll update the blog post, thanks again
No problem! The file is the configuration it loads on startup, and the command
iptables-saveis the same thing, but for the current configuration.A tip to avoid the fear of updates: use something the lvm snapshot for the / partition of the system.
I think I'll make an effort to document and publish the weird problems I run into. I never really think about it since the problems seem so trivial (I've been doing this stuff since the 1990s), but just having it indexed and searchable online could help someone some day.
So, thanks for sharing. You saved someone's day.
Yeah that was the hope -- I have a ton of blog posts in the pipeline but this one might actually help someone at some point, especially if what happened wasn't strictly just user error on my part!
Much better than finding a random forum thread where someone's like "nvm fixed it"
Use pacmatic, it makes finding and updating .pacnew files almost brainless, and would go a long way to keeping things running.
(I use alias pacman="sudo pacmatic" in my bashrc.)