Kafka Connect Operations
Operational guidance for running Kafka Connect in production.
Monitoring
Section titled “Monitoring”Key Metrics
Section titled “Key Metrics”| Metric | Description | Alert |
|---|---|---|
connector-count | Active connectors | ≠ expected |
task-count | Running tasks | ≠ expected |
connector-startup-failure-total | Startup failures | > 0 |
source-record-poll-total | Records polled | Anomaly |
sink-record-send-total | Records sent | Anomaly |
offset-commit-failure-total | Commit failures | > 0 |
deadletterqueue-produce-total | DLQ records | > 0 |
JMX MBeans
Section titled “JMX MBeans”kafka.connect:type=connector-metrics,connector={name}kafka.connect:type=connector-task-metrics,connector={name},task={id}kafka.connect:type=source-task-metrics,connector={name},task={id}kafka.connect:type=sink-task-metrics,connector={name},task={id}Health Check
Section titled “Health Check”# Cluster infocurl http://connect:8083/
# List connectorscurl http://connect:8083/connectors
# Check connector statuscurl http://connect:8083/connectors/my-connector/statusREST API Operations
Section titled “REST API Operations”Create Connector
Section titled “Create Connector”curl -X POST http://connect:8083/connectors \ -H "Content-Type: application/json" \ -d @config.jsonUpdate Configuration
Section titled “Update Configuration”curl -X PUT http://connect:8083/connectors/my-connector/config \ -H "Content-Type: application/json" \ -d @updated-config.jsonPause/Resume
Section titled “Pause/Resume”# Pausecurl -X PUT http://connect:8083/connectors/my-connector/pause
# Resumecurl -X PUT http://connect:8083/connectors/my-connector/resumeRestart
Section titled “Restart”# Restart connectorcurl -X POST http://connect:8083/connectors/my-connector/restart
# Restart specific taskcurl -X POST http://connect:8083/connectors/my-connector/tasks/0/restartDelete
Section titled “Delete”curl -X DELETE http://connect:8083/connectors/my-connectorScaling
Section titled “Scaling”Add Workers
Section titled “Add Workers”Start additional worker processes with same group.id:
# On new nodeconnect-distributed.sh config/connect-distributed.propertiesTasks automatically rebalance across workers.
Increase Tasks
Section titled “Increase Tasks”curl -X PUT http://connect:8083/connectors/my-connector/config \ -H "Content-Type: application/json" \ -d '{ "connector.class": "...", "tasks.max": "6" }'Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”| Issue | Symptom | Solution |
|---|---|---|
| Task failed | FAILED status | Check logs, fix config, restart |
| Connector not starting | UNASSIGNED tasks | Check worker logs |
| High lag | Slow processing | Scale tasks/workers |
| Memory issues | OOM errors | Increase heap, reduce batch size |
Check Task Status
Section titled “Check Task Status”curl http://connect:8083/connectors/my-connector/status | jq{ "name": "my-connector", "connector": {"state": "RUNNING", "worker_id": "worker1:8083"}, "tasks": [ {"id": 0, "state": "RUNNING", "worker_id": "worker1:8083"}, {"id": 1, "state": "FAILED", "worker_id": "worker2:8083", "trace": "..."} ]}View Worker Logs
Section titled “View Worker Logs”# Check Connect worker logstail -f /var/log/kafka-connect/connect.log | grep ERRORConfiguration Management
Section titled “Configuration Management”Validate Before Deploy
Section titled “Validate Before Deploy”curl -X PUT http://connect:8083/connector-plugins/MyConnector/config/validate \ -H "Content-Type: application/json" \ -d @config.jsonExport Configuration
Section titled “Export Configuration”curl http://connect:8083/connectors/my-connector/config > backup.jsonInternal Topics
Section titled “Internal Topics”| Topic | Purpose | Cleanup |
|---|---|---|
connect-offsets | Source offsets | Compacted |
connect-configs | Configurations | Compacted |
connect-status | Status updates | Compacted |
Verify topics exist with proper replication:
kafka-topics.sh --bootstrap-server kafka:9092 --describe \ --topic connect-offsetsRelated Documentation
Section titled “Related Documentation”- Kafka Connect - Connect overview
- Error Handling - Error tolerance
- Connectors - Connector guides