# Metricbeat kafka module kerberos authentication

**URL:** <https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 23, 2021, 7:15am UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167 "2021-02-23T07:15:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewkrrb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewkrrb/32/78907_2.png) [@drewkrrb](https://discuss.elastic.co/u/drewkrrb)\
**Post date:** [February 23, 2021, 7:15am UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/1 "2021-02-23T07:15:03Z")

</div>

Hi  
Am trying to enable metricbeat kafka module in my kafka cluster. My kafka cluster uses kerberos auth to access all the topics. Here is my current config:

```auto
# Module: kafka
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.10/metricbeat-module-kafka.html

# Kafka metrics collected using the Kafka protocol
- module: kafka
  #metricsets:
  # - partition
  # - consumergroup
  period: 10s
  hosts: ["localhost:9092"]

  client_id: metricbeat
  #retries: 3
  #backoff: 250ms

  # List of Topics to query metadata for. If empty, all topics will be queried.
  #topics: []

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

  # SASL authentication
  #username: ""
  #password: ""
  kerberos.auth_type: keytab
  kerberos.config_path: /etc/krb5.conf
  kerberos.keytab: /etc/metricbeat/certs/ex_elk.keytab
  kerberos.service_name: kafka
  kerberos.realm: NONPROD.REALM
# Metrics collected from a Kafka broker using Jolokia
- module: kafka
  metricsets:
    - broker
    - producer
    - consumer
  period: 10s
  hosts: ["localhost:8778"]

```

Am wondering if this is supported using kerberos authentication for kafka module since I don't see it in the document guides.

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [February 24, 2021, 5:04am UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/2 "2021-02-24T05:04:13Z")

</div>

Hello! I think this is added by [https://github.com/elastic/beats/pull/16871](https://github.com/elastic/beats/pull/16871). Is this what you are looking for? Thanks!

---

<div class="post-metadata">

**Author:** ![drewkrrb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewkrrb/32/78907_2.png) [@drewkrrb](https://discuss.elastic.co/u/drewkrrb)\
**Post date:** [February 24, 2021, 7:00am UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/3 "2021-02-24T07:00:47Z")

</div>

Hi thank you for replying

Yes I've done that if you can see my config above.  
But am getting this error:

```auto
2021-02-24T14:56:59.342+0800 INFO module/wrapper.go:259 Error fetching data for metricset kafka.consumergroup: error in connect: getting cluster client for advertised broker with address 10.244.17.22:9092: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
2021-02-24T14:57:09.414+0800 INFO module/wrapper.go:259 Error fetching data for metricset kafka.consumergroup: error in connect: getting cluster client for advertised broker with address 10.244.17.22:9092: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)

```

I've test the keytab file and am able to get all the topics.

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [February 25, 2021, 5:54am UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/4 "2021-02-25T05:54:59Z")

</div>

@kvch Do you know how to fix this issue? TIA!!

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [March 18, 2021, 4:04pm UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/5 "2021-03-18T16:04:12Z")

</div>

Unfortunately, Kerberos authentication is not yet added to kafka module in Metricbeat.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 15, 2021, 6:04pm UTC](https://discuss.elastic.co/t/metricbeat-kafka-module-kerberos-authentication/265167/6 "2021-04-15T18:04:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
