1. Kafka create topic appears:

Error while executing topic command org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
Copy the code

Cause: ZooKeeper was not created in kafka directory. Myid was not specified

Solution:

CD/uardata10 / CHBTMP/package/kafka_2. 10-0.8.2.1 mkdir zookeeper CD zookeeper touch myid echo 0 > myid restart kafka is okCopy the code

1.1. Create a topic that has more paration than available Bokers

Create topic specified partitions for 5 borker is only one. / bin/kafka - switchable viewer. Sh - zookeeper idc007128:2181, idc007124:2181, idc007123:2181 -topic test-replication-factor 2 -partitions 5 -create ## question Error while executing topic command replication factor: 2 larger than available brokers: 1Copy the code

To solve

-replication-factor 1 Number of duplicates is 1 [root@idc007130 kafka_2.10-0.8.2.1]#./bin/kafka-topics. Sh -zookeeper idc007128:2181,idc007124:2181,idc007123:2181 -topic test -replication-factor 1 -partitions 1 -create Created topic "test".Copy the code

Kafka broker.id is repeated

Cause: Replication of config/server.properties does not modify the host name and borker.id

[2017-06-14 18:07:55,583] FATAL FATAL error during KafkaServer startup. kafka.common.InconsistentBrokerIdException: Configured brokerId 0 doesn't match stored brokerId 1 in meta.properties at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:630) at kafka.server.KafkaServer.startup(KafkaServer.scala:175) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala)Copy the code

Solution:

Delete the log.dirs=/ TMP /kafka-logs directory and restart