本番環境でKafkaを運用するには、クラスタサイジング、レプリケーション、監視、セキュリティ、メンテナンスに注意が必要です。Kafkaは強力ですが運用が複雑な分散システムであり、信頼性を確保するには運用上の考慮事項を理解するか(またはマネージドKafkaを使用するか)ことが重要です。
クラスタセットアップと信頼性
✓ Adequate BROKERS → size the cluster for throughput, storage, and replication needs
✓ REPLICATION → replication factor ≥ 3, min.insync.replicas for durability (no data loss)
✓ Spread across racks/AZs → survive failures (rack awareness)
✓ PARTITIONS → plan partition counts for parallelism and growth (hard to reduce later)
✓ Capacity planning → throughput, retention/storage, growth
監視とメンテナンス
✓ MONITOR → consumer lag, broker health, under-replicated partitions, throughput, disk (key!)
✓ Alerting on problems (lag, under-replication, broker down, disk full)
✓ Handle DISK → retention vs storage; disk full is a serious failure
✓ UPGRADES, rebalancing partitions, scaling brokers; backup/disaster recovery
✓ KRaft (or ZooKeeper) cluster management
