title: Kafka service start fail
body: <p>I'm trying to install kafka on my Ubuntu 16.04 machine. </p>
  
  <p>I followed instruction of below link </p>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-apache-kafka-on-ubuntu-18-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-apache-kafka-on-ubuntu-18-04</a></p>
  
  <p>As I end up create /etc/systemd/system/kafka.service
  and try to start service with 'sudo systemctl start kafka' </p>
  
  <p>It doesn't print any message, I could know that starting service is failed by checking output of </p>
  
  <p><strong>sudo journalctl -u</strong></p>
  
  <p>It says</p>
  
  <p><strong>sudo journalctl -u kafka</strong> </p>
  
  <pre><code>&lt;pre&gt;&lt;code&gt;
  kafka.service: Main process exited, code=exited, status=1/FAIL
  kafka.service: Control process exited, code=exited status=1
  kafka.service: Unit entered failed state.
  kafka.service: Failed with result 'exit-code'.
  &lt;/code&gt;&lt;/pre&gt;
  </code></pre>
  
  <p><strong>cat kafka.log</strong> </p>
  
  <pre><code>&lt;pre&gt;&lt;code&gt;
  java
  [2020-02-08 00:01:08,241] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
  [2020-02-08 00:01:08,449] INFO starting (kafka.server.KafkaServer)
  [2020-02-08 00:01:08,449] INFO Connecting to zookeeper on localhost:2181 (kafka.server.KafkaServer)
  [2020-02-08 00:01:08,459] INFO [ZooKeeperClient] Initializing a new session to localhost:2181. (kafka.zookeeper.ZooKeeperClient)
  [2020-02-08 00:01:08,462] INFO Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.ZooKeeper)
  [2020-02-08 00:01:08,462] INFO Client environment:host.name=4whomtbts (org.apache.zookeeper.ZooKeeper)
  [2020-02-08 00:01:08,462] INFO Client environment:java.version=1.8.0_242 (org.apache.zookeeper.ZooKeeper)
  [2020-02-08 00:01:08,462] INFO Client environment:java.vendor=Private Build (org.apache.zookeeper.ZooKeeper)
  [2020-02-08 00:01:08,462] INFO Client environment:java.home=/usr/lib/jvm/java-8-openjdk-amd64/jre (org.apache.zookeeper.ZooKeeper)
  
  ... skipped ...
  
  [2020-02-08 00:01:15,208] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
  [2020-02-08 00:01:15,211]&lt;b&gt; ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
  kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
      at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply$mcV$sp(ZooKeeperClient.scala:268)
      at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply(ZooKeeperClient.scala:264)
      at kafka.zookeeper.ZooKeeperClient$$anonfun$kafka$zookeeper$ZooKeeperClient$$waitUntilConnected$1.apply(ZooKeeperClient.scala:264)
      at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:251)
      at kafka.zookeeper.ZooKeeperClient.kafka$zookeeper$ZooKeeperClient$$waitUntilConnected(ZooKeeperClient.scala:264)
      at kafka.zookeeper.ZooKeeperClient.&lt;init&gt;(ZooKeeperClient.scala:97)
      at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1693)
      at kafka.server.KafkaServer.kafka$server$KafkaServer$$createZkClient$1(KafkaServer.scala:348)
      at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:372)
      at kafka.server.KafkaServer.startup(KafkaServer.scala:202)
      at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
      at kafka.Kafka$.main(Kafka.scala:75)
      at kafka.Kafka.main(Kafka.scala) &lt;/b&gt;
  [2020-02-08 00:01:15,214] INFO shutting down (kafka.server.KafkaServer)
  [2020-02-08 00:01:15,218] INFO shut down completed (kafka.server.KafkaServer)
  [2020-02-08 00:01:15,218] &lt;b&gt;ERROR Exiting Kafka. &lt;/b&gt;(kafka.server.KafkaServerStartable)
  [2020-02-08 00:01:15,220] INFO shutting down (kafka.server.KafkaServer)
  
  
  &lt;/code&gt;&lt;/pre&gt;
  </code></pre>
  
  <h2><strong>+more Zookeeper information</strong></h2>
  
  <p>/var/log/zookeeper contains no file.</p>
  
  <p><strong>zookeeper.service</strong></p>
  
  <pre><code>[Unit]
  Requires=network.target remote-fs.target
  After=network.target remote-fs.target
  
  [Service]
  Type=simple
  User=kafka
  ExecStart=/home/kafka/kafka/bin/zookeeper-server-start.sh 
  /home/kafka/kafka/config/zookeeper.properties
  ExecStop=/home/kafka/kafka/bin/zookeeper-server-stop.sh
  Restart=on-abnormal
  
  [Install]
  WantedBy=multi-user.target 
  </code></pre>
  
  <p><strong>service --status-all</strong>
      <pre>
      ... skipped ... 
      [ - ]  umountnfs.sh
      [ - ]  umountroot
      [ + ]  unattended-upgrades
      [ + ]  urandom
      [ - ]  uuidd
      [ + ]  whoopsie
      [ - ]  x11-common
      <b>[ + ]  zookeeper</b>
      </pre></p>
  
  <p><strong>sudo journalctl -u zookeeper</strong></p>
  
  <pre><code>systemd[1]: Started zookeeper.service.
  systemd[1]: Started zookeeper.service.
  </code></pre>
  
  <p>I couldn't find out any clue to solve this problem by googling :( </p>
  
  <p>My environment information is.. </p>
  
  <p>Machine : LG gram 2019 15.4</p>
  
  <p>OS : Ubuntu 16.04, kernel version 5 </p>
  
  <p>java : openJDK 1.8.0</p>
  
  <p>Thank you in advance!!!</p>