How to run Kafka as non-root user?
<p>According to its <a href="https://kafka.apache.org/08/configuration.html" rel="nofollow">docs</a>, Apache Kafka logs to <code>/tmp/kafka-logs</code> by default.</p>

<p>Since <code>/tmp</code> is owned by <code>root</code> in Linux, then to me, this means that you have to run Kafka as <code>root</code> in order for it to log to that location correctly. However for security purposes, I don't want it to run as root, and so I'm trying to figure out what my options are. I <em>believe</em> I have to choose between the following:</p>

<ol>
<li>Use the <code>-Dkafka.logs.dir</code> command-line switch to specify a different location (that isn't owned by root) for logs to be written to; or</li>
<li>Modify the system ahead of time (that is, prior to starting Kafka) so that <code>/tmp/kafka-logs</code> is owned by the same user as the user that will be starting Kafka (or, in general, making sure the the Kafka user has the correct permissions to r/w/x to that directory); or</li>
</ol>

<p>Can someone clarify (or correct) that my undertanding of Linux permissions and processes is correct, and that those are my only two options? And of course, if there are any other options that will allow me to run Kafka as non-root, please chime in!</p>