1

I faced with some issue

%3|1622567567.487|FAIL|rdkafka#consumer-2| [thrd:GroupCoordinator]: GroupCoordinator: kafka:9092: Failed to resolve 'kafka:9092': Temporary failure in name resolution (after 27431ms in state CONNECT, 1 identical error(s) suppressed)

How to resolve that issue, any idea? The issue describes in the screenshot

nkafka-console-app:
    build: 
      context: dotNet/examples/
      dockerfile: Src/KafkaConsoleApp/Dockerfile
    environment:
      - producer_topic=console_topic_test
      - consumer_topic=console_topic_test
      - kafka_endpoint=kafka:9092
    depends_on:
      - kafka   
 zookeeper:
    image: confluentinc/cp-zookeeper:5.2.1
    restart: always
    environment:
     ZOOKEEPER_SERVER_ID: 1
     ZOOKEEPER_CLIENT_PORT: "2181"
     ZOOKEEPER_TICK_TIME: "2000"
    ports:
      - "2181:2181"

kafka:
    image: confluentinc/cp-enterprise-kafka:5.2.1
    depends_on:
      - zookeeper
    ports:
      - "29092:29092"
    environment:
      KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 
var config = new ProducerConfig { BootstrapServers = conf.kafka_endpoint, BatchSize = 100000, LingerMs = 100 };

var configConsumer = new ConsumerConfig
                {
                    BootstrapServers = kafkaEndpoint,
                    EnableAutoOffsetStore = false,
                    EnableAutoCommit = true,
                    AutoCommitIntervalMs = 10000,
                    AutoOffsetReset = AutoOffsetReset.Earliest,
                    GroupId = "group.id"
                };

enter image description here

enter image description here

Zookeeper logs enter image description here

enter image description here

2 Answers2

0

In your image, the broker died because it couldn't resolve zookeeper:2181. Therefore, your app will fail to resolve kafka:9092 because the broker isn't running .

You should run docker-compose logs zookeeper to verify that it started okay.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
-1

When I used docker stats I notice that ms server takes a lot of memory. It was the root of my issue