# Kafka Module Metricbeat on Kerberized cluster - jaas file

**URL:** <https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724>\
**Category:** Beats\
**Tags:** elastic-stack-monitoring, elastic-stack-security, metricbeat\
**Created:** [June 7, 2019, 9:21am UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724 "2019-06-07T09:21:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![phgolard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phgolard/32/47707_2.png) [@phgolard](https://discuss.elastic.co/u/phgolard)\
**Post date:** [June 7, 2019, 9:21am UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/1 "2019-06-07T09:21:58Z")

</div>

Hello,

On our kerberized cloudera hadoop cluster I tried to set up metricbeat kafka module to collect metricsets consumergroup and partitions.  
I set up the following kafka.yml

```auto
- module: kafka
  period: 10s
  metricsets:
    - consumergroup
    - partition
  hosts: ["localhost:9092"]
  enabled: true

  topics: []

```

If I mention hosts: ["localhost:9092"], I end up with a "connection refused".  
If I specify the ip of the broker, I end up with an ERROR " error.message: broker connection failed: EOF".

As an illustration, below is the config we used to (successfully) consume data from kafka in logstash:

```auto
input {
  kafka {
    jaas_path => "/etc/logstash/conf.d/kafka_spark_jaas.conf"
    sasl_kerberos_service_name => "kafka"
    security_protocol => "SASL_PLAINTEXT"
    kerberos_config => "/etc/krb5.conf"
    auto_offset_reset => "earliest"
    topics => ["topicName"]
    codec => "json"
    bootstrap_servers => "xxx.xxx.xxx.xxx:9092,yyy.yyy.yyy.yyy:9092,zzz.zzz.zzz.zzz:9092"
  }
}

```

So my question is : can we set the same properties to collect kafka metrics in metricbeat kafka module (jaas file, sasl\_kerberos\_service\_name)?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 7, 2019, 9:52am UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/2 "2019-06-07T09:52:48Z")

</div>

Please don't post unformatted text as it is really hard to go through. Especially YAML where the  
indentation plays a significant role too.

Instead paste the text and format it with \</\> icon, and check the preview  
window to make sure it's properly formatted before posting it. This makes it  
more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

---

<div class="post-metadata">

**Author:** ![phgolard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phgolard/32/47707_2.png) [@phgolard](https://discuss.elastic.co/u/phgolard)\
**Post date:** [June 7, 2019, 10:59am UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/3 "2019-06-07T10:59:19Z")

</div>

I've done it.  
thx for your reply

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 7, 2019, 11:25am UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/4 "2019-06-07T11:25:30Z")

</div>

I'm sorry but you still haven't. We're not trying to be pedantic, but the clearer your post is, the better are the chances for someone to step in and help you solve your problem. For example

> [@](#):
>
> - module: kafka  
> period: 10s  
> metricsets:

is not valid yaml.

---

<div class="post-metadata">

**Author:** ![phgolard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phgolard/32/47707_2.png) [@phgolard](https://discuss.elastic.co/u/phgolard)\
**Post date:** [June 7, 2019, 12:06pm UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/5 "2019-06-07T12:06:22Z")

</div>

Sorry ikavas  
This time it should be better

---

<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:** [July 5, 2019, 12:13pm UTC](https://discuss.elastic.co/t/kafka-module-metricbeat-on-kerberized-cluster-jaas-file/184724/6 "2019-07-05T12:13:42Z")

</div>

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