54 lines
801 B
Markdown
54 lines
801 B
Markdown
|
|
# 08_healthchecks.md
|
||
|
|
|
||
|
|
# Healthchecks
|
||
|
|
|
||
|
|
## Status trennen
|
||
|
|
|
||
|
|
```text
|
||
|
|
running ≠ healthy ≠ ready ≠ working
|
||
|
|
```
|
||
|
|
|
||
|
|
## HTTP Health
|
||
|
|
|
||
|
|
```text
|
||
|
|
/health /ready /api/health /actuator/health
|
||
|
|
```
|
||
|
|
|
||
|
|
Soll schnell, ohne Auth, stabil und billig sein.
|
||
|
|
|
||
|
|
## DB/Redis
|
||
|
|
|
||
|
|
```text
|
||
|
|
Postgres: pg_isready
|
||
|
|
MySQL: mysqladmin ping
|
||
|
|
Redis: redis-cli ping
|
||
|
|
```
|
||
|
|
|
||
|
|
## Einstellungen
|
||
|
|
|
||
|
|
```text
|
||
|
|
start_period für langsame Apps
|
||
|
|
interval/retries realistisch
|
||
|
|
timeout nicht zu knapp
|
||
|
|
```
|
||
|
|
|
||
|
|
## Dummy Healthcheck
|
||
|
|
|
||
|
|
`CMD true` nur temporär zur Diagnose, nie final.
|
||
|
|
|
||
|
|
## Migration/Init
|
||
|
|
|
||
|
|
One-shot Jobs nicht wie dauerhafte Services healthchecken. Ggf. `exclude_from_hc`, separater Migrationsschritt oder Entry-Migration+Start.
|
||
|
|
|
||
|
|
## No Available Server
|
||
|
|
|
||
|
|
Prüfen:
|
||
|
|
|
||
|
|
```text
|
||
|
|
unhealthy
|
||
|
|
falscher Port
|
||
|
|
localhost binding
|
||
|
|
Proxy-Ziel falsch
|
||
|
|
App noch nicht ready
|
||
|
|
```
|