docker_compose_versions/README.md
This document outlines how to create a docker-compose file for a specific Bitnami Kafka version.
2.7.0Notable Changes section.KAFKA_CFG_<config_with_underscore>In kafka-go, for all the test cases to succeed, Kafka cluster should have following server.properties along with a relevant kafka_jaas.conf mentioned in the KAFKA_OPTS. Goal is to ensure that the docker-compose file generates below server.properties.
server.properties
advertised.host.name=localhost
advertised.listeners=PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093
advertised.port=9092
auto.create.topics.enable=true
broker.id=1
delete.topic.enable=true
group.initial.rebalance.delay.ms=0
listeners=PLAINTEXT://:9092,SASL_PLAINTEXT://:9093
log.dirs=/kafka/kafka-logs-1d5951569d78
log.retention.check.interval.ms=300000
log.retention.hours=168
log.segment.bytes=1073741824
message.max.bytes=200000000
num.io.threads=8
num.network.threads=3
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
port=9092
sasl.enabled.mechanisms=PLAIN,SCRAM-SHA-256,SCRAM-SHA-512
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
socket.send.buffer.bytes=102400
transaction.state.log.min.isr=1
transaction.state.log.replication.factor=1
zookeeper.connect=zookeeper:2181
zookeeper.connection.timeout.ms=6000
run docker-compose
# docker-compose -f ./docker_compose_versions/docker-compose-<kafka_version>.yml up -d
run test cases
# go clean -cache; KAFKA_SKIP_NETTEST=1 KAFKA_VERSION=<a.b.c> go test -race -cover ./...;
In kafka-go repo, all the tests require sasl.enabled.mechanisms as PLAIN,SCRAM-SHA-256,SCRAM-SHA-512 for the Kafka cluster.
It has been observed for Kafka v101, v111, v201, v211 and v221 which are used in the circleci for build have issues with SCRAM.
There is no way to override the config sasl.enabled.mechanisms causing Kafka cluster to start up as PLAIN.
There has been some attempts made to override sasl.enabled.mechanisms
NOTE:
In Bitnami Kafka v2.3, all server.properties docker-compose environment configs start with KAFKA_CFG_<config_with_underscore>. However, it is not picking the custom populated kafka_jaas.conf.
After a lot of debugging, it has been noticed that there aren't enough privileges to create the kafka_jaas.conf. Hence the environment variables below need to be added in docker-compose to generate the kafka_jaas.conf. This issue is not noticed after kafka v2.3
KAFKA_INTER_BROKER_USER: adminplain
KAFKA_INTER_BROKER_PASSWORD: admin-secret
KAFKA_BROKER_USER: adminplain
KAFKA_BROKER_PASSWORD: admin-secret
There is a docker-compose file docker-compose-231.yml in the folder kafka-go/docker_compose_versions for reference.
For user reference, please find the some of the older kafka versions commits from the kafka commit history. For Kafka versions with no commit history, data is populated with the latest version available for the tag.
kafka-go/docker_compose_versions/docker-compose-010.ymlkafka-go/docker_compose_versions/docker-compose-011.ymlkafka-go/docker_compose_versions/docker-compose-231.yml