Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Hoofdstuk 11Naam in de cursus: Daily server work

Do the daily work on Linux servers

Even with Kubernetes and the cloud, many things still run on Linux servers: CI runners, databases, proxies, jump hosts. These 6 tools are the daily basics — the same you learn for the RHCSA exam.

  • 7 Lessen
  • 8 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

Vaardigheden in dit hoofdstuk

  • Dagelijks serverwerk — 6

11.1

systemctl — services

systemctl starts, stops, enables and checks services (units) of systemd.

systemctl status nginx
systemctl enable --now node_exporter
systemctl restart shop && systemctl is-active shop
systemctl --failed

11.2

journalctl — logs of the system

journalctl reads the logs of all services in one place.

journalctl -u shop -f
journalctl -u shop --since "10 min ago" -p err
journalctl -b -1 -p warning

11.3

ssh — log in and run commands

ssh is how you reach every server — with keys, a jump host and an ssh config file.

ssh -J bastion.example.com web1.internal
ssh web1 'sudo systemctl is-active nginx'
ssh-keygen -t ed25519 -C "hosam@laptop"

Good practice:

  • Keys only, no root login, no passwords on internet-facing servers.

11.4

rsync — copy and sync files

rsync copies only what changed — for deploys of static files, backups and migrations.

rsync -avz --delete dist/ web1:/var/www/shop/
rsync -aHAX --info=progress2 /srv/data/ backup1:/backups/data/
rsync -avn --delete dist/ web1:/var/www/shop/

Commando's in deze les

11.5

crontab — scheduled jobs

crontab runs scripts on a schedule (backups, clean-ups, reports). systemd timers are the modern choice.

crontab -l
crontab -e
systemctl list-timers

11.6

logrotate — keep log files small

logrotate rotates, compresses and deletes old log files so disks do not fill up.

logrotate -d /etc/logrotate.d/shop
logrotate -f /etc/logrotate.d/shop

11.7

Write a runbook for every server role

A short page per server role saves hours at 3 in the night.

  1. What runs here, which ports, which config files.
  2. How to check health (systemctl status, a curl URL, a dashboard link).
  3. Where the logs are (journalctl -u …, Loki labels).
  4. How to restart safely, and who must know.
  5. How backups work and when the last restore test was.

Onthoud

Every manual fix you do twice belongs in Ansible, a script or the runbook.

Alle commando's in dit hoofdstuk