简体   繁体   English

Kafka:解决错误:打开与服务器 localhost/127.0.0.1:2181 的套接字连接。 不会尝试使用 SASL 进行身份验证(未知错误)?

[英]Kafka: Resolving Error: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)?

On the startup of kafka schema registry or kafka server I am facing below error and the servers startup is failing.在启动 kafka 模式注册表或 kafka 服务器时,我遇到以下错误并且服务器启动失败。 Could someone help me resolve the below error.有人可以帮我解决以下错误。

SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

[main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket error occurred: localhost/127.0.0.1:2181: Connection refused

[main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

[main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket error occurred: localhost/127.0.0.1:2181: Connection refused

[main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

My Docker Compose file is as below -我的 Docker Compose 文件如下 -

version: "3.7"
services:
  postgres:
    image: debezium/postgres:13
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=docker
      - POSTGRES_PASSWORD=docker
      - POSTGRES_DB=exampledb

  zookeeper:
    image: confluentinc/cp-zookeeper:5.5.3
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
    ports:
      - 2181:2181

  kafka:
    image: confluentinc/cp-enterprise-kafka:5.5.3
    depends_on: [zookeeper]
    environment:
      KAFKA_ZOOKEEPER_CONNECT: "localhost:2181"
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
      KAFKA_BROKER_ID: 1
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_JMX_PORT: 9991
    ports:
      - 9092:9092

  debezium:
    image: debezium/connect:1.4
    environment:
      BOOTSTRAP_SERVERS: kafka:9092
      GROUP_ID: 1
      CONFIG_STORAGE_TOPIC: connect_configs
      OFFSET_STORAGE_TOPIC: connect_offsets
      KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
      VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
      CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
      CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
    depends_on: [kafka]
    ports:
      - 8083:8083

  schema-registry:
    image: confluentinc/cp-schema-registry:5.5.3
    environment:
      - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=localhost:2181
      - SCHEMA_REGISTRY_HOST_NAME=schema-registry
      - SCHEMA_REGISTRY_LISTENERS=http://schema-registry:8081,http://localhost:8081
    ports:
      - 8081:8081
    depends_on: [zookeeper, kafka]

KAFKA_ZOOKEEPER_CONNECT needs to point at the Zookeeper service, not the Kafka container's localhost . KAFKA_ZOOKEEPER_CONNECT需要指向 Zookeeper 服务,而不是 Kafka 容器的localhost

I suggest you start with Confluent's Docker getting started guide which has working Compose files, or Debezium documentation as well.我建议您从 Confluent 的 Docker 入门指南开始,其中包含有效的 Compose 文件或 Debezium 文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:无法从服务器读取版本:获取 http://localhost:8080/api: dial tcp 127.0.0.1:8080: connection denied - Error: couldn't read version from server: Get http://localhost:8080/api: dial tcp 127.0.0.1:8080: connection refused 连接到数据库时打开到服务器的套接字时出错 - Error opening socket to server while connecting to database Django + Docker:连接到“localhost”(127.0.0.1)的服务器,端口 5432 失败 - Django + Docker: connection to server at "localhost" (127.0.0.1), port 5432 failed Docker 容器连接到主机的 Kafka 抛出:错误:连接 ECONNREFUSED 127.0.0.1:9092 - Docker container connection to host's Kafka throws : Error: connect ECONNREFUSED 127.0.0.1:9092 出现错误“Get http://localhost:9443/metrics: dial tcp 127.0.0.1:9443: connect: connection refused” - Getting error "Get http://localhost:9443/metrics: dial tcp 127.0.0.1:9443: connect: connection refused" 错误:与 127.0.0.1:6379 的 Redis 连接失败 - 连接 ECONNREFUSED 127.0.0.1:6379 - Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 Kubernetes 从站错误 - 与服务器 localhost:8080 的连接被拒绝 - Kubernetes Slave Error - The connection to the server localhost:8080 was refused MongoDB:SASL身份验证步骤上服务器返回错误:身份验证失败 - MongoDB: server returned error on SASL authentication step: Authentication failed 错误:无法连接到本地主机:1433 - 连接 ECONNREFUSED 127.0.0.1:1433 docker - Error: Failed to connect to localhost:1433 - connect ECONNREFUSED 127.0.0.1:1433 docker 如何修复 Kafka Docker 容器抛出 0.0.0.0/0.0.0.0:2181:连接被拒绝? - How to fix Kafka Docker container from throwing 0.0.0.0/0.0.0.0:2181: Connection refused?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM