Where to start First steps track · 15 stages
Linux Labs

Load balancing — copies behind one address and health checks

cheat sheet · Ubuntu 24.04 · nginx 1.24 · keepalived 2.2 https://lab.dimsanych.ru/en/wiki/load-balancing/

Cheat sheet

  • sudo nginx -T | grep -A4 '^upstream' copies and their parameters
  • tail -n 5 /var/log/nginx/access.log $upstream_addr: who answered
  • sudo tail -n 3 /var/log/nginx/error.log why a copy dropped out
  • curl -s -o /dev/null -w '%{http_code}\n' 127.0.0.1:8082 copy alone
  • curl -s -o /dev/null -w '%{http_code} %header{x-upstream}\n' localhost
  • sudo nginx -t && sudo systemctl reload nginx apply without downtime
  • ip -br a VIP is the second address
Loading…