docker schemaregistry和kafkarest无法启动

use*_*789 2 apache-kafka docker apache-zookeeper confluent-schema-registry kafka-rest

Zookeeper 和 Kafka 沟通良好并且运行良好。

不知道为什么模式注册表和 Kafka 休息无法启动。

下面是 docker-compose 文件。

这是架构和其余 docker-compose 文件。这个泊坞窗上的错误

[main] ERROR io.confluent.admin.utils.cli.KafkaReadyCommand - Error while running kafka-ready.
java.lang.RuntimeException: No endpoints found for security protocol [PLAINTEXT]. Endpoints found in ZK [{EXTERNAL=localhost:9092, INTERNAL=kafka:29092}]
        at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:143)



[main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x1003f4a8fa10006 closed
[main] ERROR io.confluent.admin.utils.cli.KafkaReadyCommand - Error while running kafka-ready.
java.lang.RuntimeException: No endpoints found for security protocol [PLAINTEXT]. Endpoints found in ZK [{EXTERNAL=localhost:9092, INTERNAL=kafka:29092}]
        at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:143)
Run Code Online (Sandbox Code Playgroud)

码头工人组成:

schema-registry:
    network_mode: pm
    image: confluentinc/cp-schema-registry:5.2.1
    hostname: schema-registry
    container_name: schema-registry
    depends_on:
      - zookeeper
      - kafka
    ports:
      - "8081:8081"
    environment:
      SCHEMA_REGISTRY_HOST_NAME: 'schema-registry'
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
      SCHEMA_REGISTRY_LISTENERS: "http://schema-registry:8081"

  rest-proxy:
    network_mode: pm
    image: confluentinc/cp-kafka-rest:5.2.1
    depends_on:
      - zookeeper
      - kafka
      - schema-registry
    ports:
      - "8082:8082"
    hostname: rest-proxy
    container_name: rest-proxy
    environment:
      KAFKA_REST_HOST_NAME: 'rest-proxy'
      KAFKA_REST_BOOTSTRAP_SERVERS: 'kafka:29092'
      KAFKA_REST_LISTENERS: "http://rest-proxy:8082"
      KAFKA_REST_SCHEMA_REGISTRY_URL: 'http://schema-registry:8081'
      KAFKA_REST_ZOOKEEPER_CONNECT: 'zookeeper:2181' 
Run Code Online (Sandbox Code Playgroud)

这是 zk 和 kafka docker 组合

[main] ERROR io.confluent.admin.utils.cli.KafkaReadyCommand - Error while running kafka-ready.
java.lang.RuntimeException: No endpoints found for security protocol [PLAINTEXT]. Endpoints found in ZK [{EXTERNAL=localhost:9092, INTERNAL=kafka:29092}]
        at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:143)



[main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x1003f4a8fa10006 closed
[main] ERROR io.confluent.admin.utils.cli.KafkaReadyCommand - Error while running kafka-ready.
java.lang.RuntimeException: No endpoints found for security protocol [PLAINTEXT]. Endpoints found in ZK [{EXTERNAL=localhost:9092, INTERNAL=kafka:29092}]
        at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:143)
Run Code Online (Sandbox Code Playgroud)

cri*_*007 5

它无法启动,因为它不知道您正在尝试连接到两个侦听器中的哪一个。这不能通过提供 ZK 地址来确定,AFAIK。无论如何,除了 Kafka 之外,您不需要 Zookeeper。

例如,您可以使用现有的 Confluence 一体式撰写文件

特别是,请注意 REST 代理没有 ZK

https://github.com/confluenceinc/cp-all-in-one/blob/5.5.0-post/cp-all-in-one-community/docker-compose.yml#L139-L143

对于架构注册表:https://docs.confluence.io/current/schema-registry/installation/deployment.html#ak-based-primary-election

  • 因此,基本上,在 `schema-registry` 环境中,OP 必须删除 `SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL` 并添加 `SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "PLAINTEXT://kafka:29092"` 参考:kafkastore.connection.url 已[弃用。]( https://docs.confluence.io/current/schema-registry/installation/config.html#kafkastore-connection-url) (5认同)