Skip to main content

Configuration

Each configuration key can be overridden with an environment variable prefixed with KARAPACE_, the exception being keys that already start with the karapace string. For example, to override the bootstrap_uri value, use the environment variable KARAPACE_BOOTSTRAP_URI.

An example configuration file in the repository gives you an idea of what you can change.

At least one of karapace_registry and karapace_rest must be enabled for the service to start.

Common keys

ParameterDefaultDescription
bootstrap_urilocalhost:9092The Kafka service where schemas are stored and coordination among Karapace instances runs.
host127.0.0.1Listening host. Use an empty string to listen on all networks.
port8081Listening port for the Karapace server.
topic_name_schemasThe Kafka topic where schemas are stored.
group_idschema-registryKafka group name used to elect a master for storing schemas.
client_idsr-1The client id used when coordinating with other Karapace instances.
replication_factor1Replication factor for the schema topic.
karapace_registrytrueInclude the registry part of the app in the starting process.
karapace_resttrueInclude the REST part of the app in the starting process.
log_levelDEBUGLogging level.
log_handlerstdoutLog handler: stdout or systemd.

High availability / master election

ParameterDefaultDescription
advertised_hostnamesocket.gethostname()Hostname advertised to other Karapace instances in the same Kafka group.
advertised_portNonePort advertised to other instances. Falls back to port.
advertised_protocolhttpProtocol advertised to other instances.
master_eligibilitytrueWhether the instance can be promoted to master.
master_election_strategylowestBasis on which the cluster master is chosen.
waiting_time_before_acting_as_master_ms5000Time a master waits before becoming active. Should be an upper bound of the time to write and consume a message in the Kafka topic.

REST proxy

ParameterDefaultDescription
consumer_enable_autocommittrueEnable auto commit on REST proxy consumers.
consumer_request_max_bytes67108864Maximum bytes fetched per consumer request.
consumer_request_timeout_ms11000Timeout for consumer reads without their own timeout.
fetch_min_bytes1Minimum bytes fetched per consumer request.
producer_acks1Consistency level for each produced message.
producer_compression_typeNoneCompression used by REST proxy producers.
producer_max_request_size1048576Maximum size of a request in bytes.
name_strategytopic_nameName strategy for storing schemas: topic_name, record_name, or topic_record_name.
rest_authorizationfalseDelegate REST proxy authorization to Kafka over SASL using the caller's credentials.
rest_base_uriNonePublicly available URI advertised to clients for stateful operations.

TLS / security

ParameterDefaultDescription
security_protocolPLAINTEXTKafka security protocol: PLAINTEXT, SSL, SASL_PLAINTEXT, or SASL_SSL.
sasl_mechanismNoneSASL mechanism (PLAIN, SCRAM-SHA-512, OAUTHBEARER).
ssl_cafile / ssl_certfile / ssl_keyfileNoneSSL CA / cert / key used when security_protocol is SSL.
server_tls_cafile / server_tls_certfile / server_tls_keyfileNoneTLS files for the Karapace server in HTTPS mode.
server_tls_client_authnoneClient certificate requirement: none, optional, or required.
registry_authfileNoneUsers and access-control rules for HTTP basic auth. See Authentication.

Protobuf

ParameterDefaultDescription
protobuf_runtime_directoryruntimeRuntime directory for the protoc parser and code generator.
use_protobuf_formatterfalseNormalize and persist Protobuf schemas in a formatted state.

For the full list of keys, see the README.