Configuration Reference
OSO Kafka Backup uses YAML configuration files for backup and restore operations. This reference documents all available options.
Configuration Structure
# Required: Operation mode
mode: backup # or "restore"
# Required: Unique backup identifier
backup_id: "my-backup-001"
# Source/Target Kafka cluster configuration
source: # For backup mode
target: # For restore mode
bootstrap_servers: []
security: {}
topics: {}
# Storage backend configuration
storage:
backend: filesystem # or s3, azure, gcs
# Backend-specific options...
# Mode-specific options
backup: {} # Backup options
restore: {} # Restore options
# Optional Prometheus endpoint
metrics: {}
Common Configuration
mode
Required. Operation mode.
mode: backup # Run a backup operation
mode: restore # Run a restore operation
backup_id
Required. Unique identifier for the backup.
backup_id: "production-daily-001"
backup_id: "dr-backup-$(date +%Y%m%d)"
Kafka Cluster Configuration
Used as source in backup mode and target in restore mode.
bootstrap_servers
Required. List of Kafka broker addresses.
source:
bootstrap_servers:
- broker-1.kafka.svc:9092
- broker-2.kafka.svc:9092
- broker-3.kafka.svc:9092
security
Optional security configuration for Kafka connection.
source:
security:
# Security protocol
security_protocol: SASL_SSL # PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL
# SASL configuration
sasl_mechanism: SCRAM-SHA256 # PLAIN, SCRAM-SHA256, SCRAM-SHA512
sasl_username: backup-user
sasl_password: ${KAFKA_PASSWORD} # Environment variable substitution
# SSL/TLS configuration
ssl_ca_location: /etc/kafka/ca.crt
ssl_certificate_location: /etc/kafka/client.crt
ssl_key_location: /etc/kafka/client.key
ssl_key_password: ${SSL_KEY_PASSWORD}
Security Protocol Options
| Protocol | Description |
|---|---|
PLAINTEXT | No encryption, no authentication |
SSL | TLS encryption, optional mTLS |
SASL_PLAINTEXT | SASL authentication, no encryption |
SASL_SSL | SASL authentication with TLS encryption |
SASL Mechanism Options
| Mechanism | Description | Feature gate |
|---|---|---|
PLAIN | Simple username/password | Built-in |
SCRAM-SHA256 | SCRAM-SHA-256 — Salted Challenge Response (SHA-256) | Built-in |
SCRAM-SHA512 | SCRAM-SHA-512 — Salted Challenge Response (SHA-512) | Built-in |
GSSAPI | Kerberos authentication (RFC 4752). Uses a keytab for non-interactive credential acquisition. | Requires CLI built with --features gssapi |
GSSAPI is gated behind the gssapi cargo feature. The default oso/kafka-backup release binary and Docker image do not include it. A binary without the feature that loads a sasl_mechanism: GSSAPI config fails fast at startup with a clear error. See the Security Setup guide for build instructions.
SASL/GSSAPI (Kerberos) Fields
Required only when sasl_mechanism: GSSAPI. Ignored for other mechanisms.
source:
security:
security_protocol: SASL_PLAINTEXT # or SASL_SSL
sasl_mechanism: GSSAPI
sasl_kerberos_service_name: kafka
sasl_keytab_path: /etc/kafka-backup/client.keytab
sasl_krb5_config_path: /etc/krb5.conf
| Field | Type | Required | Description |
|---|---|---|---|
sasl_kerberos_service_name | string | Yes | The service-name portion of the broker's service principal. For kafka/broker.host@REALM, this is kafka. |
sasl_keytab_path | path | Yes | Absolute path to the keytab holding the client principal's long-term key. Must be readable by the kafka-backup process; lock to 0400 in production. |
sasl_krb5_config_path | path | No | Override the default /etc/krb5.conf. Useful inside containers that don't share the host's krb5 config. |
Session re-authentication (KIP-368) is handled automatically — if the broker advertises a session lifetime, kafka-backup re-handshakes at ~80 % of the window (30 s floor, ±5 s jitter) before the broker forcibly disconnects.
connection
Optional TCP connection settings. These are particularly important for cloud-hosted Kafka services like Confluent Cloud that terminate idle connections.
source:
connection:
# Enable TCP keepalive to prevent idle connection termination
tcp_keepalive: true # Default: true
# Time in seconds before first keepalive probe is sent
keepalive_time_secs: 60 # Default: 60
# Interval in seconds between keepalive probes
keepalive_interval_secs: 20 # Default: 20
# Enable TCP_NODELAY (disable Nagle's algorithm) for lower latency
tcp_nodelay: true # Default: true
fetch_max_wait_ms: 500 # 0–30000 ms; v0.28.0+
Connection Options Reference
| Option | Type | Default | Description |
|---|---|---|---|
tcp_keepalive | bool | true | Enable TCP keepalive probes |
keepalive_time_secs | int | 60 | Seconds idle before first probe |
keepalive_interval_secs | int | 20 | Seconds between probes |
tcp_nodelay | bool | true | Disable Nagle's algorithm |
fetch_max_wait_ms | int | 500 | Broker Fetch wait in ms, 0–30000 (v0.28.0+). Does not extend client timeouts or the no-progress budget |
Confluent Cloud terminates idle TCP connections after ~5 minutes. The default keepalive settings (60s time, 20s interval) prevent this. If you're experiencing "Broken pipe" errors with Confluent Cloud, ensure TCP keepalive is enabled.
topics
Topic selection for backup or restore.
source:
topics:
# Include specific topics or patterns
include:
- orders # Exact topic name
- payments # Another exact name
- "events-*" # Wildcard pattern
- "logs-2024-*" # Date-based pattern
# Exclude topics (applied after include)
exclude:
- "__consumer_offsets" # Internal Kafka topic
- "_schemas" # Schema Registry topic
- "*-internal" # Pattern exclusion