Kafka: permission denied

Hi,

I am trying to run the following command to start kafka, but it is giving permission denied error:
bin/kafka-server-start.sh config/server.properties

But I am getting permission denied error.
[2017-01-03 07:15:09,515] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
java.io.FileNotFoundException: /var/kafka-logs/.lock (Permission denied)

How can I avoid this error? Please help.

Thanks,
Pratyush

Where are you getting this error in big data lab?

Hi,

I am trying to run the command from below location:
/usr/hdp/2.5.0.0-1245/kafka

Thanks,
Pratyush

Pratyush,

You dont need to start the Kafka. By default it is started in the Ambari.

Please check here: http://gw01.itversity.com:8080/#/main/services/KAFKA/configs

I am able to create topics in the kafka cluster.

Let me know if you need any help.

Thanks,
Krish.

kafka needs directory to write logs in to.
so u need to create kafka-logs explicitly as give all the 777 permissions for the directory and run the server.

Hi Kirsh/Team,
I am unable to create topic.

[ajayk22330@gw01 bin]$ ./kafka-topics.sh --create --zookeeper 172.16.1.100:2181 --replication-factor 1 --partitions 2 --topic truck_events
[2017-02-02 20:40:37,580] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[2017-02-02 20:40:38,684] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[2017-02-02 20:40:39,785] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
^Z
[2]+ Stopped ./kafka-topics.sh --create --zookeeper 172.16.1.100:2181 --replication-factor 1 --partitions 2 --topic truck_events
[ajayk22330@gw01 bin]$

you can ignore this error and if the logs.dir property in server.properties directory has read and write permissions or not. The default location is /tmp/kafka-logs if there is one broker.

OK, if so may i know how to create a topic in the provided cluster environment ?

first check whether the zk is running or not? And verify its port number