Category: Docker

0

Docker Compose - Kafka 클러스터 구성하기

목차 Docker Compose - Kafka 사용하기 Docker Compose - Kafka 클러스터 구성하기 zookeeper 설정version: "3.6"services: zookeeper: container_name: zookeeper image: wurstmeister/zookeeper:3.4.6 volumes: - "./zookeeper/data:/data" - "./zookeeper/logs:/datalog" ports: - "2181:2181" Kafka 설정 KAFKA_BROKER_ID KAFKA_ZOOKEEPER_CONNECT KAFKA_ADVERTISED_HOST_NAME KAFKA_ADVERTISED_PORT KAFKA_CREATE_TOPICS KAFKA_ADVERTISED_LISTENERS KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2 version: "3.6"... kafka1: container_name: kafka1 image: wurstmeister/kafka:2.12-2.3.0 restart: on-failure ports: - "9092:9092" volumes: - /var/run/docker.sock:/var/run/docker.sock environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_HOST_NAME: 192.168.0.2 KAFKA_ADVERTISED_PORT: 9092 KAFKA_CREATE_TOPICS: "temp_topic:1:1" KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.0.2:9092 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2 depends_on: - zookeeper 전체 소스 코드version: "3.6"services: zookeeper: container_name: zookeeper image: wurstmeister/zookeeper:3.4.6 volumes: - "./zookeeper/data:/data" - "./zookeeper/logs:/datalog" ports: - "2181:2181" kafka1: container_name: kafka1 image: wurstmeister/kafka:2.12-2.3.0 restart: on-failure ports: - "9092:9092" volumes: - /var/run/docker.sock:/var/run/docker.sock environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_HOST_NAME: 192.168.0.2 KAFKA_ADVERTISED_PORT: 9092 KAFKA_CREATE_TOPICS: "temp_topic:1:1" KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.0.2:9092 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2 depends_on: - zookeeper kafka2: container_name: kafka2 image: wurstmeister/kafka:2.12-2.3.0 restart: on-failure ports: - "9093:9092" volumes: - /var/run/docker.sock:/var/run/docker.sock environment: KAFKA_BROKER_ID: 2 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_HOST_NAME: 192.168.0.2 KAFKA_ADVERTISED_PORT: 9092 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.0.2:9093 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2 depends_on: - zookeeper kafka3: container_name: kafka3 image: wurstmeister/kafka:2.12-2.3.0 restart: on-failure ports: - "9094:9092" volumes: - /var/run/docker.sock:/var/run/docker.sock environment: KAFKA_BROKER_ID: 3 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_ADVERTISED_HOST_NAME: 192.168.0.2 KAFKA_ADVERTISED_PORT: 9092 KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.0.2:9094 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2 depends_on: - zookeeper

0

Docker Compose - Kafka 사용하기

목차 Docker Compose - Kafka 사용하기 Docker Compose - Kafka 클러스터 구성하기 Zookeeper 설정version: "3"services: zookeeper: container_name: local-zookeeper image: wurstmeister/zookeeper ports: - 2181:2181 Kafka 설정version: "3"services: zookeeper: container_name: local-zookeeper image: wurstmeister/zookeeper ports: - 2181:2181 kafka: container_name: local-kafka image: wurstmeister/kafka depends_on: - zookeeper ports: - 9092:9092 environment: KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 volumes: - /var/run/docker.sock:/var/run/docker.sock 전체 소스 코드version: "3"services: zookeeper: container_name: local-zookeeper image: wurstmeister/zookeeper ports: - 2181:2181 kafka: container_name: local-kafka image: wurstmeister/kafka depends_on: - zookeeper ports: - 9092:9092 environment: KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 volumes: - /var/run/docker.sock:/var/run/docker.sock

0

Docker - Jenkins 사용하기

Docker - Jenkins 사용하기# lts버전으로 실행시docker run -d -p 8090:8080 -p 50000:50000 -v ~/docker/jenkins:/var/jenkins_home jenkins/jenkins:lts# jdk11버전으로 실행시docker run -d -p 8090:8080 -p 50000:50000 -v ~/docker/jenkins-jdk11:/var/jenkins_home jenkins/jenkins:jdk11# docker container Id3c29b7adb686ad8310bf474fe91406e1ab8c569568e2ef2b5d09f40525aa78ee

0

Docker - MySQL 사용하기

Docker - MySQL 사용하기docker pull mysql:8.0.17 Docker MySQL 컨테이너 생성 및 실행 MySQL 외부 볼륨으로 잡아주기 호스트의 ~/docker/mysql 디렉토리를 MySQL 컨테이너의 /var/lib/mysql 디렉토리로 마운트 docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password --name mysql -v ~/docker/mysql:/var/lib/mysql mysql --character-set-server=utf8mb4 docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password --name mysql -v ~/docker/mysql:/var/lib/mysql mysql:8.0.17 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci