homelab/docs/Complete and Partial Rackdown.md

98 lines
5.7 KiB
Markdown
Raw Normal View History

# About
"Rackdown" is AWS slang for turning a rack of hosts off and on again. In this case, the "rack" refers to practically all components of the DC. Server, NAS, disk shelf, switches, router, PiHole, modem, APs, and desktops. This doc will consolidate previous docs and provide an overall shutdown and reboot procedure.
# Overview (Dependency Graph)
```mermaid
flowchart TD;
CLN["CenturyLink node"]<--Depends--ONT;
ONT<--Cat5e-->Modem[ISP Modem/Router];
Modem<--Cat5e-->Router[Ubiquiti EdgeRouter 10X];
Router<--Cat5e-->switch_homelab[NetGear 8-Port Switch for Homelab];
switch_homelab<--Cat6-->desktop_joey[Joey's Desktop];
switch_homelab<--Cat5-->desktop_bridget[Bridget's Desktop];
switch_homelab<--Cat6-->NAS;
NAS<--SFP+ DAC-->Desktop;
NAS<--SFP+ DAC-->Server;
switch_homelab<--Cat6-->Server;
switch_homelab<--Cat6-->Seedbox;
switch_homelab<--Cat5e-->Pihole;
Router<--Cat5e-->switch_basementtv[TP-Link 5-Port Switch for Basement TV];
switch_basementtv<--Cat6-->desktop_maddie[Maddie's Desktop];
switch_basementtv<--Cat5e-->client_tv_downstairs[Downstairs TV];
Router<--Cat6-->wap_basement[Ubiquiti Unifi U6-Lite];
wap_basement<--Wifi6 2.4/5GHz-->clients_wireless_basement[Basement Wireless Clients];
Router<--Cat6-->wap_upstairs[Ubiquiti Unifi UAP-AC-LR];
wap_upstairs<--Wifi5 2.4/5GHz-->clients_wireless_upstairs[Upstairs Wireless Clients];
Router<--Cat6-->desktop_mom[Mom's Desktop];
Router<--Cat6-->desktop_dad[Dad's Desktop];
Router<-->desktop_gus[Gus' Desktop];
```
2022-07-14 00:01:00 -07:00
# Per-Node Reboot Instructions
For each of these, it is assumed that all dependent nodes have already been shut down as necessary.
## Rebooting the ONT
1. Unplug the 6-pin power plug. Wait 15 seconds.
2. Plug the power plug back in. Wait for the top three lights to be solid green.
2022-07-14 00:01:00 -07:00
## Rebooting the modem (Zyxel C3000Z)
1. Unplug the barrel power plug. Wait 15 seconds.
2. Plug the power plug back in. Wait for the "Power" and "WAN/LAN" lights to be solid green (the WAN/LAN light might flicker, that's okay. )
2022-07-14 00:01:00 -07:00
## Rebooting the Router (Ubiquiti EdgeRouter 10X)
1. Uplug the barrel power plug. Wait 15 seconds.
2. Plug the power plug back in. Wait for the indicator LED to be solid white.
2022-07-26 10:50:25 -07:00
## Server
### Shutdown
2022-07-14 00:01:00 -07:00
1. SSH into the router to reconfigure its DNS resolution.
2. Reconfigure the router's DNS resolution:
```
configure
delete system name-server 192.168.1.23
set system name-server 1.1.1.1
delete service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 dns-server 192.168.1.23
set service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 dns-server 1.1.1.1
commit; save; exit
```
2022-08-02 22:36:18 -07:00
3. Shut down Minecraft servers: `cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== SHUTTING DOWN $service =====" && docker-compose -f $service down; done`
4. Shut down remaining services: `for app in ~/homelab/server/config/*; do echo "===== SHUTTING DOWN $app =====" && cd $app && docker-compose down; done`
2022-07-26 10:50:25 -07:00
5. Shut down the host: `sudo shutdown now`. Wait 30 seconds. If the green power LED doesn't turn off, hold the power button until it does.
### Boot
2022-07-14 00:01:00 -07:00
6. Press the power button on the front of the chassis to begin booting. Take note of any POST beeps during this time. Wait for the host to be accessible via SSH.
7. Check current running docker containers
2022-07-30 01:17:28 -07:00
8. Confirm all SMB shares are mounted with `mount -t cifs`. If not mounted, run `mount -a` for all shares.
9. Start most services: `for app in ~/homelab/server/config/*; do echo "===== STARTING $app =====" && cd $app && docker-compose up -d; done`
10. Start Minecraft servers: `cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== STARTING $service =====" && docker-compose -f $service up -d; done`
11. Reconfigure the router's DNS resolution:
2022-07-14 00:01:00 -07:00
```
configure
delete system name-server 1.1.1.1
set system name-server 192.168.1.23
delete service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 dns-server 1.1.1.1
set service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 dns-server 192.168.1.23
commit; save; exit
```
2022-07-30 01:17:28 -07:00
## NAS
### Shutdown
2022-07-26 10:50:25 -07:00
1. Follow the instructions to shut down the Server.
2022-07-30 01:17:28 -07:00
2. SSH into the NAS and run `shutdown -p now`. Wait 30 seconds. If the green power LED doesn't turn off, hold the power button until it does.
2022-07-26 10:50:25 -07:00
3. Unplug the power connections to the disk shelf.
2022-07-30 01:17:28 -07:00
### Boot
2022-07-26 10:50:25 -07:00
4. Plug power and SAS into the disk shelf. Wait for all disks to boot. About 2-3 minutes. Wait about 30 extra seconds to be safe.
2022-07-30 01:17:28 -07:00
5. Plug power, ethernet, and SAS into the NAS. Power on the NAS and wait for the SSH server to become responsive. This can take more than 5 minutes. Note: The WebUI will not be accessible at `https://nas.jafner.net` until the server is also booted. It is accessible at `http://joey-nas/ui/sessions/signin`.
2022-07-26 10:50:25 -07:00
### Recreate all Docker containers one-liner
```bash
STACKS_RESTARTED=0 && for app in ~/homelab/server/config/*; do echo "===== RECREATING $app =====" && cd $app && docker-compose up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== RECREATING $service =====" && docker-compose -f $service up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) ====="
```
2022-07-15 12:15:18 -07:00
### Recreate based on list of containers
```bash
2022-07-17 13:45:00 -07:00
STACKS_RESTARTED=0 && for app in calibre-web homer jdownloader2 librespeed monitoring navidrome qbittorrent send stashapp traefik; do echo "===== RECREATING $app =====" && cd ~/homelab/server/config/$app && docker-compose up -d && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) =====" && cd ~
2022-07-15 12:15:18 -07:00
```