-
-
Save dobeerman/7ba3c9814a8fb14431d4a547dfe7fac4 to your computer and use it in GitHub Desktop.
Revisions
-
dkurzaj revised this gist
Feb 16, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,11 +19,11 @@ $ docker-compose -f docker-compose.yml up -d - Access Kafka Manager : http://localhost:9000/. - Add a new cluster. - Name it as you like (**Localtest** for example). - IP : localhost:2181 - Kafka version (corresponding here to the Kafka version inside the image : **wurstmeister/kafka:1.0.0**). But as I write this Gist, the latest Kafka version available in Kafka Manager is **0.11.0.0** so I select this one, but it's sufficiently compatible with the 1.0.0 version of Kafka according to this topic: https://github.com/yahoo/kafka-manager/issues/451 @@ -33,7 +33,7 @@ $ docker-compose -f docker-compose.yml up -d - Tick **Enable Active OffsetCache** to see the offsets And then save it. :sparkles: This is done ! :sparkles: -
dkurzaj revised this gist
Feb 16, 2018 . 2 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Gist inspired by this one intending to be an updated version of it : https://gis ## Install - Create the environment variable that contains our host name (IP address) : ``` $ export EXPOSED_HOSTNAME=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') ``` - Create the folders : This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,8 +21,8 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - KAFKA_ZOOKEEPER_CONNECT=${EXPOSED_HOSTNAME}:2181 - KAFKA_ADVERTISED_HOST_NAME=${EXPOSED_HOSTNAME} - JMX_PORT=9093 - KAFKA_ADVERTISED_PORT=9092 - KAFKA_DELETE_TOPIC_ENABLE=true @@ -46,7 +46,7 @@ services: - zookeeper command: -Dconfig.file=/kafka-manager/conf/application.conf -Dapplication.home=/kafkamanager environment: - ZK_HOSTS=${EXPOSED_HOSTNAME} - APPLICATION_SECRET=letmein ports: - "9000:9000" -
dkurzaj revised this gist
Feb 16, 2018 . 1 changed file with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ # Docker compose Kafka, Zookeeper and Kafka manager Gist inspired by this one intending to be an updated version of it : https://gist.github.com/17twenty/d619f922ab209f750630824f7c6836e3 ## Install - Create the environment variable that contains our host name (IP address) : ``` @@ -46,9 +47,4 @@ $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose. - Remove content of Docker volumes (we need to do this trick to remove hidden and non-hidden files) : ``` $ rm -rf zookeeper/{data,logs} && mkdir -p zookeeper/{data,logs} ``` -
dkurzaj revised this gist
Feb 16, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,7 +34,7 @@ $ docker-compose -f docker-compose.yml up -d And then create it. :sparkles: This is done ! :sparkles: ## Uninstall - Stop the containers and remove them : @@ -48,4 +48,7 @@ $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose. $ rm -rf zookeeper/{data,logs} && mkdir -p zookeeper/{data,logs} ``` Gist inspired by this one intending to be an updated version of it : https://gist.github.com/17twenty/d619f922ab209f750630824f7c6836e3 -
dkurzaj revised this gist
Feb 16, 2018 . 2 changed files with 28 additions and 33 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ # Docker compose Kafka, Zookeeper and Kafka manager ## Install - Create the environment variable that contains our host name (IP address) : ``` $ export DOCKER_HOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') ``` - Create the folders : ``` $ mkdir -p zookeeper/{data,logs} ``` ## Run @@ -24,7 +24,7 @@ $ docker-compose -f docker-compose.yml up -d - IP : zookeeper:2181 - Kafka version (corresponding here to the Kafka version inside the image : **wurstmeister/kafka:1.0.0**). But as I write this Gist, the latest Kafka version available in Kafka Manager is **0.11.0.0** so I select this one, but it's sufficiently compatible with the 1.0.0 version of Kafka according to this topic: https://github.com/yahoo/kafka-manager/issues/451 - Tick **Enable JMX Polling** in order to see the metrics of the topics @@ -42,13 +42,10 @@ This is done ! $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose.yml rm -vf ``` ## Tips - Remove content of Docker volumes (we need to do this trick to remove hidden and non-hidden files) : ``` $ rm -rf zookeeper/{data,logs} && mkdir -p zookeeper/{data,logs} ``` Gist inspired by this one intending to be an updated version of it : https://gist.github.com/17twenty/d619f922ab209f750630824f7c6836e3 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,5 @@ version: '3.1' services: zookeeper: container_name: zookeeper @@ -15,27 +10,32 @@ services: - "./zookeeper/logs:/datalog" ports: - "2181:2181" network_mode: "host" kafka: container_name: kafka image: wurstmeister/kafka:1.0.0 restart: on-failure depends_on: - zookeeper volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - KAFKA_ZOOKEEPER_CONNECT=${DOCKER_HOST}:2181 - KAFKA_ADVERTISED_HOST_NAME=${DOCKER_HOST} - JMX_PORT=9093 - KAFKA_ADVERTISED_PORT=9092 - KAFKA_DELETE_TOPIC_ENABLE=true - KAFKA_LOG_RETENTION_HOURS=1 - KAFKA_MESSAGE_MAX_BYTES=10000000 - KAFKA_REPLICA_FETCH_MAX_BYTES=10000000 - KAFKA_GROUP_MAX_SESSION_TIMEOUT_MS=60000 - KAFKA_NUM_PARTITIONS=2 - KAFKA_DELETE_RETENTION_MS=1000 ports: - "9092:9092" - "9093:9093" network_mode: "host" kafka-manager: container_name: kafka-manager @@ -44,12 +44,10 @@ services: depends_on: - kafka - zookeeper command: -Dconfig.file=/kafka-manager/conf/application.conf -Dapplication.home=/kafkamanager environment: - ZK_HOSTS=${DOCKER_HOST} - APPLICATION_SECRET=letmein ports: - "9000:9000" network_mode: "host" -
dkurzaj revised this gist
Feb 15, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Docker compose Kafka, Zookeeper and Kafka manager ## Install - Create the network : ``` -
dkurzaj revised this gist
Feb 15, 2018 . 2 changed files with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,12 @@ $ docker-compose -f docker-compose.yml up -d - Kafka version (corresponding here to the Kafka version inside the image : **ches/kafka:0.10.2.1**) : 0.10.2.1 - Tick **Enable JMX Polling** in order to see the metrics of the topics - Tick **Poll consumer information** to know the consumer of a topic (it may not work) - Tick **Enable Active OffsetCache** to see the offsets And then create it. This is done ! This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,11 +29,13 @@ services: - "./kafka/logs:/logs" environment: - ZOOKEEPER_IP=zookeeper - JMX_PORT=7203 - JAVA_RMI_SERVER_HOSTNAME=kafka - KAFKA_LOG_RETENTION_HOURS=168 - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true ports: - "9092:9092" - "7203:7203" kafka-manager: container_name: kafka-manager -
dkurzaj revised this gist
Feb 15, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,4 +39,10 @@ $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose. - Remove the docker network : ``` $ docker network rm kafka-net ``` ## Tips - Remove content of Docker volumes (we need to do this trick to remove hidden and non-hidden files) : ``` $ rm -rf {zookeeper,kafka}/{data,logs} && mkdir -p {zookeeper,kafka}/{data,logs} ``` -
dkurzaj revised this gist
Feb 15, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,5 +38,5 @@ $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose. - Remove the docker network : ``` $ docker network rm kafka-net ``` -
dkurzaj revised this gist
Feb 15, 2018 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,13 @@ And then create it. This is done ! ## Uninstall - Stop the containers and remove them : ``` $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose.yml rm -vf ``` - Remove the docker network : ``` docker network rm kafka-net ``` -
dkurzaj revised this gist
Feb 15, 2018 . 1 changed file with 36 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ # How to use ## Install - Create the network : ``` $ docker network create --driver bridge kafka-net ``` - Create the folders : ``` $ mkdir -p {zookeeper,kafka}/{data,logs} ``` ## Run - Execute the docker compose : ``` $ docker-compose -f docker-compose.yml up -d ``` - Access Kafka Manager : http://localhost:9000/. - Create a new cluster. - Name it as you like (**Localtest** for example). - IP : zookeeper:2181 - Kafka version (corresponding here to the Kafka version inside the image : **ches/kafka:0.10.2.1**) : 0.10.2.1 And then create it. This is done ! To stop the containers and remove them, run : ``` $ docker-compose -f docker-compose.yml stop && docker-compose -f docker-compose.yml rm -vf ``` -
dkurzaj created this gist
Feb 15, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ version: '3.1' networks: default: external: name: kafka-net services: zookeeper: container_name: zookeeper image: zookeeper:3.4 restart: on-failure volumes: - "./zookeeper/data:/data" - "./zookeeper/logs:/datalog" ports: - "2181:2181" kafka: container_name: kafka image: ches/kafka:0.10.2.1 restart: on-failure depends_on: - zookeeper links: - zookeeper volumes: - "./kafka/data:/data" - "./kafka/logs:/logs" environment: - ZOOKEEPER_IP=zookeeper - JMX_PORT=9994 - KAFKA_LOG_RETENTION_HOURS=168 - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true ports: - "9092:9092" kafka-manager: container_name: kafka-manager image: hlebalbau/kafka-manager:1.3.3.16 restart: on-failure depends_on: - kafka - zookeeper links: - kafka - zookeeper command: -Dconfig.file=/kafka-manager/conf/application.conf -Dkafka-manager.zkhosts="zookeeper:2181" environment: - ZK_HOSTS=zookeeper:2181 - APPLICATION_SECRET=letmein ports: - "9000:9000"