Skip to content

Commit af10c1f

Browse files
committed
Add schema registry to Kafka tools
1 parent 3e9571d commit af10c1f

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

tools/kafka/docker-compose/README.adoc

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,45 @@ TIP: To start the containers in the foreground simply add `-d` to the start comm
2020
=== Control Center UI
2121
Runs a https://docs.confluent.io/platform/current/control-center/index.html[Confluent Control Center] that exposes a UI at http://locahost:9021.
2222

23-
NOTE: It is expected that the brokers are already running
23+
NOTE: The scripts must be chained together as the UI depends on the brokers
2424

25-
To start the Control Center run the following command:
25+
To start the brokers and the Control Center UI run the following command:
2626
[source,shell]
2727
----
28-
docker-compose -f ./control-center-ui.yml up
28+
docker-compose -f ./kafka-cluster.yml -f ./control-center-ui.yml up
2929
----
30-
To stop the Control Center run the following command:
30+
To stop the brokers and the Control Center UI run the following command:
3131
[source,shell]
3232
----
33-
docker-compose -f ./control-center-ui.yml down
33+
docker-compose -f ./kafka-cluster.yml -f ./control-center-ui.yml down
3434
----
3535

36-
TIP: The scripts can be chained together to start both cluster and UI in a single command
36+
=== Schema Registry
37+
Runs a https://docs.confluent.io/platform/current/schema-registry/index.html[Confluent Schema Registry] available at http://locahost:8081.
38+
39+
NOTE: The scripts must be chained together as the schema registry depends on the brokers
40+
41+
To start the brokers and the schema registry run the following command:
3742
[source,shell]
3843
----
39-
docker-compose -f kafka-cluster.yml -f ./control-center-ui.yml up`
44+
docker-compose -f ./kafka-cluster.yml -f ./schema-registry.yml up
45+
----
46+
To stop the brokers and the schema registry run the following command:
47+
[source,shell]
4048
----
49+
docker-compose -f ./kafka-cluster.yml -f ./schema-registry.yml down
50+
----
51+
52+
=== All The Things
53+
The scripts can be chained together to start the cluster, UI and schema registry with the following commmand:
54+
[source,shell]
55+
----
56+
docker-compose -f kafka-cluster.yml -f ./control-center-ui.yml -f ./schema-registry.yml up
57+
----
58+
Likewise, to stop all the things:
59+
[source,shell]
60+
----
61+
docker-compose -f kafka-cluster.yml -f ./control-center-ui.yml -f ./schema-registry.yml down
62+
----
63+
64+
TIP: The only "UI" representation of the schema registry is by navigating to a `Topic` and then clicking the `Schema` tab for the topic

tools/kafka/docker-compose/control-center-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
#CONTROL_CENTER_CONNECT_CONNECT-DEFAULT_CLUSTER: 'connect:8083'
2222
#CONTROL_CENTER_KSQL_KSQLDB1_URL: "http://ksqldb-server:8088"
2323
#CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: "http://localhost:8088"
24-
#CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
24+
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
2525
CONTROL_CENTER_REPLICATION_FACTOR: 1
2626
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
2727
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '2'
2+
3+
# Runs a Confluent Schema Registry instance on 'http://localhost:8081'.
4+
#
5+
# Pre-requisites: The brokers are already running.
6+
7+
services:
8+
schema-registry:
9+
image: confluentinc/cp-schema-registry:7.0.1
10+
hostname: schema-registry
11+
container_name: schema-registry
12+
depends_on:
13+
- broker1
14+
- broker2
15+
- broker3
16+
ports:
17+
- "8081:8081"
18+
environment:
19+
SCHEMA_REGISTRY_HOST_NAME: schema-registry
20+
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker1:29091,broker2:29092,broker3:29093'
21+
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
22+
SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: WARN

0 commit comments

Comments
 (0)