-
kafka docker-compose 로 가동하기Linux 2023. 10. 25. 14:58
ubuntu 22.04 / 2023-10-25 일 테스트되었다. 1. docker 설치
https://haengsin.tistory.com/128
2. docker 일반 계정으로 가동하기
https://eventhorizon.tistory.com/149
3. docker-compose.yml 작성하기
services: zookeeper: image: bitnami/zookeeper:latest hostname: zoo0 ports: - "2181:2181" environment: ALLOW_ANONYMOUS_LOGIN: "yes" restart: unless-stopped kafka: image: bitnami/kafka:latest hostname: kafka0 ports: - "9092:9092" environment: KAFKA_BROKER_ID: 1 ALLOW_PLAINTEXT_LISTENER: "yes" KAFKA_CFG_ZOOKEEPER_CONNECT: zoo0:2181 KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: CONTROLLER KAFKA_CFG_ADVERTISED_LISTENERS: CONTROLLER://172.30.1.123:9092 KAFKA_CFG_LISTENERS: CONTROLLER://0.0.0.0:9092 KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "true" KAFKA_NUM_PARTITIONS: 1 volumes: - /var/run/docker.sock:/var/run/docker.sock depends_on: - zookeeper restart: unless-stopped kafka-ui: image: provectuslabs/kafka-ui:latest container_name: cluster-kafka-ui ports: - "9080:8080" environment: KAFKA_CLUSTERS_0_NAME: local KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: PLAINTEXT://172.30.1.123:9092 KAFKA_CLUSTERS_0_ZOOKEEPER: zoo0:2181 depends_on: - zookeeper - kafka restart: unless-stopped
4. kafka 실행하기
$ docker-compose up -d [주의] 내용중 172.30.1.123 은 설치하려는 machine 의 private-ip 로 변경 해주자.
5. 작동 확인
http://127.0.0.1:9080/ web 대시 보드에 접속해서 상태를 확인할 수 있다.
'Linux' 카테고리의 다른 글
ollama + ollama_webui 간편 설치 및 실행 script (0) 2024.05.09 Ubuntu 22.04 HP Prime virtual calculator 설치 (0) 2024.04.11 Get local private ip using shell script (0) 2022.10.14 Ubuntu 22.04 Reset nvidia graphic driver (0) 2022.09.20 Linux 에서 android debugging 개발/디버깅하기 (0) 2020.11.17