title: Kafka fails to start while configuring JMX exporter
body: <p>I am trying to setup JMX exporter for Kafka running on a compute Instance (CentOS 7).</p>
  
  <p>I downloaded the JMX Exporter jar and the Kafka yaml from the following location.</p>
  
  <pre><code>wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar
  wget https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/kafka-0-8-2.yml
  </code></pre>
  
  <p>I set the below environment variables in the "/etc/systemd/system/kafka.service" file as below:</p>
  
  <pre><code>Environment="KAFKA_OPTS=$KAFKA_OPTS -javaagent:/home/kafka_user/jmx_kafka_exporter/jmx_prometheus_javaagent-0.12.0.jar=7070:/home/kafka_user/jmx_kafka_exporter/kafka-0-8-2.yml"
  </code></pre>
  
  <p>After performing a reload and restart; Kafka fails to start.</p>
  
  <p>Would highly appreciate any suggestions to run JMX exporter for Kafka hosted on a compute instance.</p>
  
  <p>Thank you in Advance,</p>
  
  <pre><code>sudo systemctl daemon-reload
  sudo systemctl restart kafka
  
  sudo systemctl status kafka
  ● kafka.service - Kafka Daemon
  Loaded: loaded (/etc/systemd/system/kafka.service; enabled; vendor preset: disabled)
  Active: failed (Result: start-limit) since Thu 2020-03-26 06:05:52 UTC; 935ms ago
  Process: 9842 ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties (code=exited, status=1/FAILURE)
  Main PID: 9842 (code=exited, status=1/FAILURE)
  
  Mar 26 06:05:51 kafka1.com systemd[1]: Unit kafka.service entered failed state.
  Mar 26 06:05:51 kafka1.com systemd[1]: kafka.service failed.
  Mar 26 06:05:52 kafka1.com systemd[1]: kafka.service holdoff time over, scheduling restart.
  Mar 26 06:05:52 kafka1.com systemd[1]: Stopped Kafka Daemon.
  Mar 26 06:05:52 kafka1.com systemd[1]: start request repeated too quickly for kafka.service
  Mar 26 06:05:52 kafka1.com systemd[1]: Failed to start Kafka Daemon.
  Mar 26 06:05:52 kafka1.com systemd[1]: Unit kafka.service entered failed state.
  Mar 26 06:05:52 kafka1.com systemd[1]: kafka.service failed.
  </code></pre>
  
  <p>cat /etc/systemd/system/kafka.service </p>
  
  <pre><code>[Unit]
  Description=Kafka Daemon
  Requires=network.target
  After=network.target
  
  [Service]
  LimitNOFILE=65536
  Environment="JMX_PORT=5555"
  Environment="KAFKA_OPTS=-javaagent:/home/kafka_user/jmx_kafka_exporter/jmx_prometheus_javaagent-0.12.0.jar=7070:/home/kafka_user/jmx_kafka_exporter/kafka-2_0_0.yml"
  Type=simple
  User=kafka
  Group=kafka
  UMask=0027
  ExecStart=/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
  Restart=on-failure
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>