Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

How to run / configure outside kubernetes/strimzi #22

Closed
julienmmm opened this issue May 20, 2019 · 5 comments
Closed

How to run / configure outside kubernetes/strimzi #22

julienmmm opened this issue May 20, 2019 · 5 comments
Labels
project meta Project infrastructure, docs, etc.
Milestone

Comments

@julienmmm
Copy link

Hello,

I am trying to run the kafka-lag-exporter as a classic stand alone application.
To do that, I've built the project with "sbt clean dist" which has produced a zip file under target/universal. After unzipping I am able to start the exporter with "./bin/kafka-lag-exporter".
My problem is that it is not very clear for me how you can configure a static cluster definition, the documentation stated that it is possible to create an application.conf file but I could not find any documentation on its structure.

Thanks for your help!

Julien

@seglo
Copy link
Owner

seglo commented May 21, 2019

Hi Julien,

Thanks for trying out Kafka Lag Exporter. The standalone run use case is indeed something I haven't spent time to document. You can use the reference.conf to determine what configuration you can override in your application.conf. For example, to setup several static clusters you might define:

kafka-lag-exporter {
  clusters = [
    {
       name = "clusterA"
       bootstrap-brokers = "b-1.cluster-a.xyzcorp.com:9092,b-2.cluster-a.xyzcorp.com:9092"
    }
    {
       name = "clusterB"
       bootstrap-brokers = "b-1.cluster-b.xyzcorp.com:9092,b-2.cluster-b.xyzcorp.com:9092"
    }
  ]
}

Please share your experiences running the project in standalone mode. I would welcome a section in the README documenting this.

@seglo seglo added the project meta Project infrastructure, docs, etc. label May 21, 2019
@seglo seglo added this to the 0.4.1 milestone May 21, 2019
@NeQuissimus
Copy link
Contributor

I had this up and running pretty quickly like so:

docker run -p 8000:8000 -e KAFKA_LAG_EXPORTER_CLUSTERS.0.name="dev" -e KAFKA_LAG_EXPORTER_CLUSTERS.0.bootstrap-brokers="testbroker1:9092" lightbend/kafka-lag-exporter:0.4.0

You can then hit http://localhost:8000

@julienmmm
Copy link
Author

julienmmm commented May 26, 2019

With this simple application.conf file:

kafka-lag-exporter {
  port = 9107
  poll-interval = 30 seconds
  lookup-table-size = 60
  client-group-id = "kafkalagexporter"
  kafka-client-timeout = 10 seconds
  clusters = [
    {
       name = "kafkatst"
       bootstrap-brokers = "kafkatst01:9092,kafkatst02:9092,kafkatst03:9092"
    }
  ]
  watchers = {
    strimzi = "false"
  }
}

akka {
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  loglevel = "DEBUG"
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}

I have successfully run the lag exporter by executing kafka-lag-exporter -Dconfig.file=application.conf

However I am not very familiar with scala applications and Ithink that this configuraton file could be better (especially related to logging).

@seglo
Copy link
Owner

seglo commented May 27, 2019

This looks good @julienmmm. The reference.conf serves as a place to define defaults when an application.conf is not provided and/or fallbacks when one is provided. You can reduce your config to:

kafka-lag-exporter {
  port = 9107
  clusters = [
    {
       name = "kafkatst"
       bootstrap-brokers = "kafkatst01:9092,kafkatst02:9092,kafkatst03:9092"
    }
  ]
}

@seglo
Copy link
Owner

seglo commented Jun 6, 2019

Documented in #29

@seglo seglo closed this as completed Jun 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
project meta Project infrastructure, docs, etc.
Projects
None yet
Development

No branches or pull requests

3 participants