我使用docker-compose在本地运行带有zookeper和架构注册表的kafka。
当我使用Avro序列化程序运行生产者和消费者时,一切正常,我在控制中心的Kafka中看到_schemas
主题。但是,当我导航到控制中心的“管理”->“主题”时,我没有为主题设置任何模式。它说This topic is not set up with schema registry
。也许我想念什么?这是我的Kafka撰写文件
zookeeper:
image: confluentinc/cp-zookeeper:5.0.0
networks:
- docker-network
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-enterprise-kafka:5.0.0
networks:
- docker-network
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_METRIC_REPORTERS: "io.confluent.metrics.reporter.ConfluentMetricsReporter"
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: "kafka:9092"
CONFLUENT_METRICS_REPORTER_TOPIC_CREATE: "false"
schema-registry:
image: confluentinc/cp-schema-registry:5.0.0
networks:
- docker-network
depends_on:
- zookeeper
- kafka
environment:
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
control-center:
image: confluentinc/cp-enterprise-control-center:5.0.0
networks:
- docker-network
ports:
- "9021:9021"
depends_on:
- zookeeper
- kafka
- schema-registry
environment:
CONTROL_CENTER_ZOOKEEPER_CONNECT: "zookeeper:2181"
CONTROL_CENTER_BOOTSTRAP_SERVERS: "kafka:9092"
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
CONTROL_CENTER_INTERNAL_TOPICS_REPLICATION: 1
CONTROL_CENTER_COMMAND_TOPIC_REPLICATION: 1
CONTROL_CENTER_METRICS_TOPIC_REPLICATION: 1
CONTROL_CENTER_STREAMS_NUM_STREAM_THREADS: 1