A basic Kafka+Jolokia setup with Docker, without any ENV mappings. Bring your own server.properties file!
Using Docker Compose:
% docker-compose up
% kafkacat -L -b localhost:9092
% echo "hello" | kafkacat -P -b localhost:9092 -t hello-logs
% kafkacat -C -b localhost:9092 -t hello-logs
To use your own server.properties file, run something like:
docker run --rm -v $PWD/server.properties:/etc/kafka/server.properties dylanmei/kafka
To override server.properties values, run the kafka-server-start.sh command with --override arguments:
docker run --rm dylanmei/kafka bin/kafka-server-start.sh \
config/server.properties \
--override broker.id=123 \
--override zookeeper.connect=example:2181
Use the Jolokia API endpoint to query for metrics. Example:
% curl -s http://localhost:8778/jolokia/search/java.lang:type=* | jq '.'
% curl -s http://localhost:8778/jolokia/read/java.lang:type=ClassLoading | jq '.'
J4PSH is another way to explore Jolokia. Example:
% docker run --rm -it \
--network=dockerkafka_default \
jolokia/jmx4perl j4psh --color=no http://kafka-broker:8778/jolokia
Content type
Image
Digest
Size
151.4 MB
Last updated
over 9 years ago
docker pull dylanmei/kafka