-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
173 lines (173 loc) · 7.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
173 lines (173 loc) · 7.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# docker-compose supports environment variable substitution with the ${VARIABLE-NAME} syntax.
# Environment variables can be sourced in a variety of ways. One of those ways is through
# a well known '.env' file located in the same folder as the docker-compose.yml file. See the Docker
# documentation for details: https://docs.docker.com/compose/environment-variables/#the-env-file
#
# This feature is being used to parameterize some values within this file. In this directory is also
# a .env file, which is actually a symbolic link to <examples-root>/utils/config.env. That file
# contains values which get substituted here when docker-compose parses this file.
#
# If you'd like to view the docker-compose.yml file rendered with its environment variable substituions
# you can execute the `docker-compose config` command. Take note that some demos provide additional
# environment variable values by exporting them in a script prior to running `docker-compose up`.
---
version: "2.2"
services:
srcZookeeper:
image: ${REPOSITORY}/cp-zookeeper:${CONFLUENT_DOCKER_TAG}
restart: always
hostname: srcZookeeper
container_name: srcZookeeper
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: "2181"
ZOOKEEPER_TICK_TIME: "2000"
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/zookeeper_jaas.conf
-Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
-DrequireClientAuthScheme=sasl
ports:
- "2181:2181"
volumes:
- $PWD/scripts/security:/etc/kafka/secrets
destZookeeper:
image: ${REPOSITORY}/cp-zookeeper:${CONFLUENT_DOCKER_TAG}
restart: always
hostname: destZookeeper
container_name: destZookeeper
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: "2281"
ZOOKEEPER_TICK_TIME: "2000"
ports:
- "2281:2281"
srcKafka1:
image: ${REPOSITORY}/cp-server:${CONFLUENT_DOCKER_TAG}
hostname: srcKafka1
container_name: srcKafka1
depends_on:
- srcZookeeper
ports:
- "10091:10091"
volumes:
- $PWD/scripts/security:/etc/kafka/secrets
environment:
KAFKA_ZOOKEEPER_CONNECT: "srcZookeeper:2181"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: SASL_PLAINTEXT:SASL_PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: SASL_PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: SASL_PLAINTEXT://srcKafka1:10091
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: "false"
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/broker_jaas.conf
destKafka1:
image: ${REPOSITORY}/cp-server:${CONFLUENT_DOCKER_TAG}
hostname: destKafka1
container_name: destKafka1
depends_on:
- destZookeeper
ports:
- "11091:11091"
environment:
KAFKA_ZOOKEEPER_CONNECT: "destZookeeper:2281"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://destKafka1:11091
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
connect:
image: ${REPOSITORY}/cp-server-connect:${CONFLUENT_DOCKER_TAG}
container_name: connect
restart: always
ports:
- "8083:8083"
depends_on:
- destZookeeper
- destKafka1
volumes:
- mi3:/usr/share/replicator/kafka-connect-replicator/
environment:
CONNECT_BOOTSTRAP_SERVERS: "destKafka1:11091"
CONNECT_LISTENERS: "http://0.0.0.0:8083"
CONNECT_CONFIG_STORAGE_TOPIC: connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: connect-statuses
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_GROUP_ID: "connect"
CONNECT_LOG4J_ROOT_LOGLEVEL: INFO
CONNECT_REST_ADVERTISED_HOST_NAME: "connect"
CONNECT_PLUGIN_PATH: "/usr/share/replicator"
CONNECT_REPLICATION_FACTOR: 1
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
replicator-for-jar-transfer:
image: ${REPOSITORY}/cp-enterprise-replicator:${CONFLUENT_DOCKER_TAG}
hostname: replicator-for-jar-transfer
container_name: replicator-for-jar-transfer
volumes:
- mi3:/usr/share/java/kafka-connect-replicator/
command: "sleep infinity"
srcKafkaClient:
image: ${REPOSITORY}/cp-server:${CONFLUENT_DOCKER_TAG}
hostname: srcKafkaClient
container_name: srcKafkaClient
depends_on:
- srcKafka1
volumes:
- $PWD/scripts/security:/etc/kafka/secrets
- $PWD/testData:/etc/kafka/testData
command: "bash -c -a 'echo Waiting for Kafka to be ready... && \
/etc/confluent/docker/configure && \
cub kafka-ready -b srcKafka1:10091 1 60 --config /etc/kafka/kafka.properties && \
kafka-topics --bootstrap-server srcKafka1:10091 --command-config /etc/kafka/secrets/srcKafkaClient_sasl.properties --topic testTopic --create --replication-factor 1 --partitions 6 && \
kafka-console-producer --broker-list srcKafka1:10091 --topic testTopic --producer.config /etc/kafka/secrets/srcKafkaClient_sasl.properties < /etc/kafka/testData/testData.txt'"
environment:
# The following settings are listed here only to satisfy the image's requirements.
# We override the image's `command` anyways, hence this container will not start a broker.
KAFKA_BROKER_ID: ignored
KAFKA_ZOOKEEPER_CONNECT: ignored
KAFKA_ADVERTISED_LISTENERS: ignored
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
KAFKA_SECURITY_PROTOCOL: SASL_PLAINTEXT
KAFKA_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required \
username=\"client\" \
password=\"client-secret\";"
KAFKA_SASL_MECHANISM: PLAIN
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/client_jaas.conf
destKafkaClient:
image: ${REPOSITORY}/cp-server:${CONFLUENT_DOCKER_TAG}
hostname: destKafkaClient
container_name: destKafkaClient
depends_on:
- destKafka1
- connect
volumes:
- $PWD/scripts:/etc/kafka/scripts
- $PWD/scripts/security:/etc/kafka/secrets
command: "bash -c -a 'echo Waiting for Kafka to be ready... && \
/etc/confluent/docker/configure && \
cub kafka-ready -b destKafka1:11091 1 60 --config /etc/kafka/kafka.properties && \
sleep 30 && \
echo submitting replicator && \
/etc/kafka/scripts/submit_replicator_source_sasl_plain_auth.sh && \
echo submitted replicator'"
environment:
# The following settings are listed here only to satisfy the image's requirements.
# We override the image's `command` anyways, hence this container will not start a broker.
KAFKA_BROKER_ID: ignored
KAFKA_ZOOKEEPER_CONNECT: ignored
KAFKA_ADVERTISED_LISTENERS: ignored
volumes:
mi3: {}