-4

How to configure health check for kafka Kraft controller ?

      KAFKA_KRAFT_CLUSTER_ID: ulBKTl3BSeOGO3Hn8SOu-Q
      KAFKA_CFG_PROCESS_ROLES: controller
      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 50000@kafka_controller_0:49090,60000@kafka_controller_1:49091,70000@kafka_controller_2:49092
      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
      KAFKA_CFG_INTER_BROKER_LISTENER_NAME: INTERNAL
      KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: true
      KAFKA_CFG_AUTO_LEADER_REBALANCE_ENABLE: true
      KAFKA_CFG_UNCLEAN_LEADER_ELECTION_ENABLE: true
      KAFKA_CFG_REPLICATION_QUOTA_WINDOW_NUM: 11
      KAFKA_CFG_REPLICATION_QUOTA_WINDOW_SIZE_SECONDS: 1
      KAFKA_CFG_NODE_ID: 50000
      KAFKA_CFG_LISTENERS: CONTROLLER://:49090
      KAFKA_JMX_PORT: 49190
      KAFKA_JMX_HOSTNAME: kafka_controller_0
healthcheck:
      test: ["CMD", "kafka-broker-api-versions", "--bootstrap-server", "kafka_controller_0:49090"]
      interval: 30s
      timeout: 10s
      retries: 3
1
  • Regarding the downvotes 1) Don't repeat the title on the post itself 2) Include in the question why what you've shown isn't working and what you expect to happen instead. 3) Ensure that the question is readable and formatted before you actually submit the question. Refer help center Commented Nov 5, 2024 at 7:55

1 Answer 1

0

Your bootstrap server should just be localhost if you want to use a kafka command

Otherwise, nc -vz localhost:49090 would test that port has been opened or use some test -d command to check folder existence for Kafka logs

Sign up to request clarification or add additional context in comments.

4 Comments

Can you please give full code snippet
You already have what you need in the question. Why can't you replace the command test: ["CMD", "nc", "-vz", "localhost:49090"]?
Yes, but it fails for dependency check
Fails how/where? Is Kafka not running, then? What to the logs say?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.