Unable to start Zookeeper and Kafka in Itversity labs


#1

I am using gw02 server and trying to start zookeepr and kafka …however It throws me some error .
Cannot open file /usr/hdp/current/kafka-broker/bin/…/logs/zookeeper-gc.log due to Permission denied
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /usr/hdp/current/kafka-broker/bin/…/logs/state-change.log (Permission denied)

I am using below command to start the server

./zookeeper-server-start.sh ~/kafka/config/zookeeper.properties


#2

Kafka and Zookeeper are always running in Itversity Labs. Admins will take care if they are down.


#3

Do I need to use some sudo user to create kafka topics? I am not able to create kafka topicc using command…?
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test


#4

I am getting below error while trying to create topics:
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)
[2018-05-31 12:08:56,719] 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)
[2018-05-31 12:08:57,820] 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)
Exception in thread “main” org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 30000
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1232)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:156)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:130)
at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:75)
at kafka.utils.ZkUtils$.apply(ZkUtils.scala:57)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:54)
at kafka.admin.TopicCommand.main(TopicCommand.scala)


#5

i haven’t used the labs but you might need to pass all zookeeper instances comma separated with no space
ex: --zookeeper localhost:2181,host:port

give that a shot


#6

To use Kafka in Itversity Labs -