0

I am trying to install Kafka following a tutorial from DigitalOcean.com here.

I am doing this on Windows WSL2 with Ubuntu. So, after creating the zookeeper.service and kafka.service as per the tutorial, I do this command (the tutorial uses sudo systemctl start kafka instead), following advice from this thread:

sudo service kafka start

I received :

kafka: unrecognized service

When I do service --status-all to see if kafka is in the list, it is not there.

What am I missing?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Tristan Tran
  • 1,351
  • 1
  • 10
  • 36

1 Answers1

1

There is lack of support in WSL for systemd

why systemd is disabled in WSL?

Ran Lupovich
  • 1,655
  • 1
  • 6
  • 13
  • 1
    I was at step 4 and got stuck at starting the kafka service. I found another article [here](https://www.confluent.io/blog/set-up-and-run-kafka-on-windows-linux-wsl-2/#install-java) that works completely. So I will close this thread. Thanks for helping. – Tristan Tran Jun 03 '21 at 17:02
  • Also, the command ```sudo service kafka enable``` yields the same error ```kafka: unrecognized service```. Same for ```zookeeper```. – Tristan Tran Jun 03 '21 at 17:03
  • The suggested solution is to directly execute the start of the service, thats what unit files are for... but I guess if you are just looking to make it run for development it is ok, the real answe is that you probably missing the /etc/systemd/system/kafka.service – Ran Lupovich Jun 03 '21 at 18:21
  • I do have the file ```/etc/systemd/system/kafka.service``` and ```/etc/systemd/system/zookeeper.service```. In both articles, the steps require these two files to be created. I just don't know why it does not recognize both services in the DigitalOcean article. – Tristan Tran Jun 03 '21 at 18:47
  • Try the following: systemctl daemon-reload , and then the start again – Ran Lupovich Jun 03 '21 at 18:49
  • I got this error ```System has not been booted with systemd as init system (PID 1). Can't operate.``` when running that command. – Tristan Tran Jun 03 '21 at 18:52
  • Instead of using sudo systemctl start kafka use: sudo /etc/init.d/kafka start as of right now seems there not have systemd in WSL – Ran Lupovich Jun 03 '21 at 18:55
  • 1
    Seems lack of systemd in WSL – Ran Lupovich Jun 03 '21 at 18:56
  • 1
    https://stackoverflow.com/questions/55579342/why-systemd-is-disabled-in-wsl – Ran Lupovich Jun 03 '21 at 18:57