version: '2' services: zookeeper: image: "confluentinc/cp-zookeeper:4.0.0" hostname: zookeeper ports: - '32181:32181' environment: ZOOKEEPER_CLIENT_PORT: 32181 ZOOKEEPER_TICK_TIME: 2000 extra_hosts: - "moby:127.0.0.1" kafka: image: "confluentinc/cp-enterprise-kafka:4.0.0" hostname: kafka ports: - '9092:9092' - '29092:29092' depends_on: - zookeeper environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: kafka:29092 CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:32181 CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1 CONFLUENT_METRICS_ENABLE: 'true' CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous' extra_hosts: - "moby:127.0.0.1" schema-registry: image: "confluentinc/cp-schema-registry:latest" hostname: schema-registry depends_on: - zookeeper - kafka ports: - '8081:8081' environment: SCHEMA_REGISTRY_HOST_NAME: schema-registry SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:32181 extra_hosts: - "moby:127.0.0.1" # Runs the Kafka KSQL data generator for topic called "pageviews" ksql-datagen-pageviews: image: "confluentinc/ksql-examples:0.5" hostname: ksql-datagen-pageviews depends_on: - kafka - schema-registry # Note: The container's `run` script will perform the same readiness checks # for Kafka and Confluent Schema Registry, but that's ok because they complete fast. # The reason we check for readiness here is that we can insert a sleep time # for topic creation before we start the application. command: "bash -c 'echo Waiting for Kafka to be ready... && \ cub kafka-ready -b kafka:29092 1 20 && \ echo Waiting for Confluent Schema Registry to be ready... && \ cub sr-ready schema-registry 8081 20 && \ echo Waiting a few seconds for topic creation to finish... && \ sleep 2 && \ java -jar /usr/share/java/ksql-examples/ksql-examples-4.1.0-SNAPSHOT-standalone.jar quickstart=pageviews format=delimited topic=pageviews bootstrap-server=kafka:29092 maxInterval=100 iterations=1000 && \ java -jar /usr/share/java/ksql-examples/ksql-examples-4.1.0-SNAPSHOT-standalone.jar quickstart=pageviews format=delimited topic=pageviews bootstrap-server=kafka:29092 maxInterval=1000'" environment: KSQL_CONFIG_DIR: "/etc/ksql" KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties" STREAMS_BOOTSTRAP_SERVERS: kafka:29092 STREAMS_SCHEMA_REGISTRY_HOST: schema-registry STREAMS_SCHEMA_REGISTRY_PORT: 8081 extra_hosts: - "moby:127.0.0.1" # Runs the Kafka KSQL data generator for topic called "clickstream" ksql-datagen-clickstream: image: "confluentinc/ksql-examples:0.5" hostname: ksql-datagen-clickstream depends_on: - kafka - schema-registry # Note: The container's `run` script will perform the same readiness checks # for Kafka and Confluent Schema Registry, but that's ok because they complete fast. # The reason we check for readiness here is that we can insert a sleep time # for topic creation before we start the application. command: "bash -c 'echo Waiting for Kafka to be ready... && \ cub kafka-ready -b kafka:29092 1 20 && \ echo Waiting for Confluent Schema Registry to be ready... && \ cub sr-ready schema-registry 8081 20 && \ echo Waiting a few seconds for topic creation to finish... && \ sleep 2 && \ java -jar /usr/share/java/ksql-examples/ksql-examples-4.1.0-SNAPSHOT-standalone.jar quickstart=clickstream format=json topic=clickstream bootstrap-server=kafka:29092 maxInterval=100 iterations=500000'" environment: KSQL_CONFIG_DIR: "/etc/ksql" KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties" STREAMS_BOOTSTRAP_SERVERS: kafka:29092 STREAMS_SCHEMA_REGISTRY_HOST: schema-registry STREAMS_SCHEMA_REGISTRY_PORT: 8081 extra_hosts: - "moby:126.0.0.1" # Runs the Kafka KSQL data generator for topic called "clickstream_codes" ksql-datagen-clickstream_codes: image: "confluentinc/ksql-examples:0.5" hostname: ksql-datagen-clickstream_codes depends_on: - kafka - schema-registry # Note: The container's `run` script will perform the same readiness checks # for Kafka and Confluent Schema Registry, but that's ok because they complete fast. # The reason we check for readiness here is that we can insert a sleep time # for topic creation before we start the application. command: "bash -c 'echo Waiting for Kafka to be ready... && \ cub kafka-ready -b kafka:29092 1 20 && \ echo Waiting for Confluent Schema Registry to be ready... && \ cub sr-ready schema-registry 8081 20 && \ echo Waiting a few seconds for topic creation to finish... && \ sleep 2 && \ java -jar /usr/share/java/ksql-examples/ksql-examples-4.1.0-SNAPSHOT-standalone.jar quickstart=clickstream_codes format=json topic=clickstream_codes bootstrap-server=kafka:29092 maxInterval=20 iterations=1000'" environment: KSQL_CONFIG_DIR: "/etc/ksql" KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties" STREAMS_BOOTSTRAP_SERVERS: kafka:29092 STREAMS_SCHEMA_REGISTRY_HOST: schema-registry STREAMS_SCHEMA_REGISTRY_PORT: 8081 extra_hosts: - "moby:126.0.0.1" # Runs the Kafka KSQL data generator for topic called "clickstream_codes" ksql-datagen-clickstream_users: image: "confluentinc/ksql-examples:0.5" hostname: ksql-datagen-clickstream_users depends_on: - kafka - schema-registry # Note: The container's `run` script will perform the same readiness checks # for Kafka and Confluent Schema Registry, but that's ok because they complete fast. # The reason we check for readiness here is that we can insert a sleep time # for topic creation before we start the application. command: "bash -c 'echo Waiting for Kafka to be ready... && \ cub kafka-ready -b kafka:29092 1 20 && \ echo Waiting for Confluent Schema Registry to be ready... && \ cub sr-ready schema-registry 8081 20 && \ echo Waiting a few seconds for topic creation to finish... && \ sleep 2 && \ java -jar /usr/share/java/ksql-examples/ksql-examples-4.1.0-SNAPSHOT-standalone.jar quickstart=clickstream_users format=json topic=clickstream_users bootstrap-server=kafka:29092 maxInterval=10 iterations=1000'" environment: KSQL_CONFIG_DIR: "/etc/ksql" KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties" STREAMS_BOOTSTRAP_SERVERS: kafka:29092 STREAMS_SCHEMA_REGISTRY_HOST: schema-registry STREAMS_SCHEMA_REGISTRY_PORT: 8081 extra_hosts: - "moby:126.0.0.1" # Runs the Kafka KSQL application ksql-rest: image: "confluentinc/ksql-cli:0.5" hostname: ksql-rest ports: - '8082:8082' depends_on: - kafka - schema-registry - ksql-datagen-clickstream - ksql-datagen-clickstream_codes - ksql-datagen-clickstream_users command: "bash -c 'cd /usr/bin/ && mkdir ui && cd ui && wget https://s3.amazonaws.com/ksql-experimental-ui/ksql-experimental-ui-0.1.war && \ echo bootstrap.servers=kafka:29092 > /etc/ksql/ksqlserver.properties ; \ echo application.id=ksql_server_quickstart >> /etc/ksql/ksqlserver.properties ; \ echo ksql.command.topic.suffix=commands >> /etc/ksql/ksqlserver.properties ; \ echo listeners=http://0.0.0.0:8082 >> /etc/ksql/ksqlserver.properties ; \ echo ui.enabled=true >> /etc/ksql/ksqlserver.properties ; \ pushd /tmp && wget http://get.arcadiadata.com/ksql/clickstream-schema.sql && popd && \ cd .. && /usr/bin/ksql-server-start /etc/ksql/ksqlserver.properties'" environment: KSQL_CONFIG_DIR: "/etc/ksql" KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties" STREAMS_BOOTSTRAP_SERVERS: kafka:29092 STREAMS_SCHEMA_REGISTRY_HOST: schema-registry STREAMS_SCHEMA_REGISTRY_PORT: 8081 extra_hosts: - "moby:127.0.0.1"