파일구조
docker-compose.yml 파일
version: '2.1'
services:
zookeeper-1:
hostname: zookeeper-1
container_name: zookeeper-1
image: zookeeper:3.6
restart: always
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=zookeeper-1:2888:3888;2181 server.2=zookeeper-2:2888:3888;2181 server.3=zookeeper-3:2888:3888;2181
volumes:
- type: bind
source: ./data/zk-cluster/zookeeper-1/data
target: /data
read_only: false
zookeeper-2:
hostname: zookeeper-2
container_name: zookeeper-2
image: zookeeper:3.6
restart: always
ports:
- 2182:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zookeeper-1:2888:3888;2181 server.2=zookeeper-2:2888:3888;2181 server.3=zookeeper-3:2888:3888;2181
volumes:
- type: bind
source: ./data/zk-cluster/zookeeper-2/data
target: /data
read_only: false
zookeeper-3:
hostname: zookeeper-3
container_name: zookeeper-3
image: zookeeper:3.6
restart: always
ports:
- 2183:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zookeeper-1:2888:3888;2181 server.2=zookeeper-2:2888:3888;2181 server.3=zookeeper-3:2888:3888;2181
volumes:
- type: bind
source: ./data/zk-cluster/zookeeper-3/data
target: /data
read_only: false
zookeeper-navigator:
hostname: zookeeper-navigator
container_name: zookeeper-navigator
image: elkozmon/zoonavigator:1.1.2
restart: always
ports:
- 9000:9000
environment:
HTTP_PORT: 9000
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
docker-compose up -d
docker-compose up -d 이후 파일 구조
도커 컨테이너 상태 확인
'Data Engineering > Kafka' 카테고리의 다른 글
[Zookeeper] 주키퍼 마스터 찾는 방법 (0) | 2022.06.08 |
---|---|
[Zookeeper] Zookeeper cluster + Zookeeper UI (0) | 2022.06.08 |
[kafka] 카프카 클러스터 만드는 방법 (0) | 2022.01.31 |
[kafka] 카프카 토픽 생성하는 방법 (0) | 2022.01.31 |
[kafka] 카프카 클러스터를 GUI(kafdrop)으로 구축하기 (0) | 2022.01.30 |