Quick Start
Deploy single-node and 3-node Kafka clusters from scratch, with secure access, parameter tuning, and launch checklist.
Kafka is a distributed event-streaming platform. Pigsty’s KAFKA module deploys Apache Kafka 4.x dynamic KRaft clusters on managed nodes from RPM/DEB packages, with unified management of security, resources, lifecycle, and observability.
The Kafka module is currently in Beta. Test it thoroughly and confirm it meets your requirements before using it in serious production. That includes dynamic KRaft, strict rolling restart, TLS/SCRAM/ACL, declarative topics/users, credential and certificate rotation, and the full monitoring pipeline.
The KAFKA module currently provides:
controller.quorum.voters renderedcombined, broker, and controller, in both combined and separated topologiesplaintext and the production scram; the latter enables TLS, SCRAM-SHA-512, controller mTLS, ACLs, and default-deny authorizationThe KAFKA module depends on NODE for node management, the package repository, and base monitoring, and on INFRA for VictoriaMetrics, VictoriaLogs, Grafana, and Alertmanager.
flowchart LR
admin["Pigsty admin node"] -->|"kafka.yml / exact cluster"| kafka["Kafka 4.x / dynamic KRaft"]
kafka --> jmx["Each Kafka JVM / JMX :9404"]
kafka --> exporter["Up to two brokers / kafka_exporter :9308"]
kafka --> journal["Journald"]
jmx --> vm["VictoriaMetrics"]
exporter --> vm
journal --> vector["Vector"] --> vl["VictoriaLogs"]
vm --> grafana["Grafana"]
vl --> grafana
vm --> alert["Alertmanager"]
style kafka fill:#70C1B3,stroke:#4f968b,color:#fff
style vm fill:#E66B7A,stroke:#b84e5c,color:#fff
style vl fill:#C98367,stroke:#9e634e,color:#fff
style grafana fill:#F29C64,stroke:#c77845,color:#fffEvery Kafka JVM has a JMX Exporter injected and is registered as job=kafka. The protocol-level kafka_exporter runs only on the first two broker-capable nodes ordered by kafka_seq; a single-broker cluster runs only one, and pure controllers run none. They return the same logical-cluster view, so recording rules deduplicate before aggregating.
| Document | Contents |
|---|---|
| Quickstart | From a single node to a three-node secure cluster: client access, parameter changes, and go-live checks |
| Cluster Config | Topology, dynamic KRaft, network, storage, security, and resource declarations |
| Parameters | 15 persistent public parameters plus transient operational variables |
| Administration | Status checks, topics, messages, consumer groups, and topology changes |
| Playbook | kafka.yml lifecycle, task tags, rotation, and teardown safeguards |
| Monitoring | Metrics pipeline, dashboards, log queries, and alert rules |
| Metrics | Metric dictionary for JMX, the protocol exporter, and recording rules |
| FAQ | Questions on roles, identity, security, exporters, and scaling |
The Quickstart offers a complete path from scratch, building up step by step:
If you are already familiar with Kafka/Pigsty, jump straight to Cluster Config or Parameters.
| Port | Service | Deployment scope | plaintext | scram |
|---|---|---|---|---|
9092 | Kafka Broker | Broker-capable nodes | PLAINTEXT | SASL_SSL + SCRAM-SHA-512 |
9093 | KRaft Controller | Controller-capable nodes | PLAINTEXT | Mutual TLS |
9308 | kafka_exporter | Up to two broker-capable nodes | HTTP metrics | HTTP metrics, TLS/SCRAM on the backend |
9404 | JMX Exporter | All Kafka nodes | HTTP metrics | HTTP metrics |
All four ports must differ from one another, and all are adjustable via parameters. The HTTP ports of the JMX and protocol exporters should still be restricted to the monitoring network by firewall.
The current role provides a core production baseline for Kafka, not a replacement for a full streaming platform or a managed service. The following capabilities still require an explicit runbook or a separate component:
add-controller/remove-controller procedures; editing the manifest itself never adds or removes a voterdefault.replication.factor after scale-out: Kafka 4.3 requires an explicit data-migration and static-config maintenance windowplaintext to scramThese boundaries should be documented explicitly in your production plan, approval process, and drills; they cannot be substituted by rerunning an ordinary inventory.
Deploy single-node and 3-node Kafka clusters from scratch, with secure access, parameter tuning, and launch checklist.
Plan Kafka dynamic KRaft topology, identity, network, storage, security, and declarative resources.
15 persistent public parameters and transient protected operational variables of the KAFKA module.
Kafka cluster health, declarative resources, messages, consumer groups, and topology changes.
Run dynamic KRaft lifecycle, strict rolling, resource convergence, rotation, and removal with kafka.yml and kafka-rm.yml.
Kafka metrics collection, Grafana dashboards, log queries, and alerting rules.
Kafka JMX, protocol exporter, and recording rule metrics dictionary.
Frequently asked questions about the Pigsty Kafka 4.x dynamic KRaft module.
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.