I am trying to learn about Apache Kafka. It tried a simple Kafka installation on Linux and tried using the consumer and producer API to test the communication.
I went through few tutorials on how to install and use Kafka. One thing I realized is that every tutorial started with creating a new user (e.g. sudo useradd kafka -m)
What is the importance of this?
This is not specific for Kafka. And is not mandatory, as far as I know.
What you are reading about is a Unix service account.
In terms of what this means to Kafka, your user account (ideally not root
) cannot directly modify critical data to the operation of Kafka (intentionally or, more importantly, by accident). User ownership should include your Kafka configuration directory, data directory, and application logs.
Also, if there is ever some JVM security hole for remote execution, then the kafka
user/group should have limited system access outside of its Kafka resources.