From 114b773cd7db1475768ae04547e03fd47361e74d Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 26 Jul 2017 05:49:46 +0200 Subject: [PATCH] Clarifies a gotcha: to mount config with log4j.properties ... you must use /opt/kafka/config, due to how log4j.properites (sometimes tools- or connect-) are resolved by the ./bin scripts. See https://github.com/solsson/dockerfiles/pull/10 --- 50kafka.yml | 4 +++- zookeeper/50pzoo.yml | 2 ++ zookeeper/51zoo.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/50kafka.yml b/50kafka.yml index deee06f8..dcc4e949 100644 --- a/50kafka.yml +++ b/50kafka.yml @@ -30,6 +30,8 @@ spec: - name: broker image: solsson/kafka:0.11.0.0@sha256:e0dec6aa1f376bd374a6ca5863b783d01703acf1f71c0c4441a217a7bd80dfbc env: + - name: KAFKA_LOG4J_OPTS + value: -Dlog4j.configuration=file:/opt/kafka/config/log4j.properties - name: JMX_PORT value: "5555" ports: @@ -39,7 +41,7 @@ spec: - -c - > ./bin/kafka-server-start.sh - config/server.properties + ./config/server.properties --override zookeeper.connect=zookeeper:2181 --override log.retention.hours=-1 --override log.dirs=/var/lib/kafka/data/topics diff --git a/zookeeper/50pzoo.yml b/zookeeper/50pzoo.yml index 4cfd3d4b..ff289d8b 100644 --- a/zookeeper/50pzoo.yml +++ b/zookeeper/50pzoo.yml @@ -39,6 +39,8 @@ spec: - name: zookeeper image: solsson/kafka:0.11.0.0@sha256:e0dec6aa1f376bd374a6ca5863b783d01703acf1f71c0c4441a217a7bd80dfbc env: + - name: KAFKA_LOG4J_OPTS + value: -Dlog4j.configuration=file:/opt/kafka/config/log4j.properties - name: JMX_PORT value: "5555" command: diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml index cbc0af1f..067096de 100644 --- a/zookeeper/51zoo.yml +++ b/zookeeper/51zoo.yml @@ -39,6 +39,8 @@ spec: - name: zookeeper image: solsson/kafka:0.11.0.0@sha256:e0dec6aa1f376bd374a6ca5863b783d01703acf1f71c0c4441a217a7bd80dfbc env: + - name: KAFKA_LOG4J_OPTS + value: -Dlog4j.configuration=file:/opt/kafka/config/log4j.properties - name: JMX_PORT value: "5555" command: