0

I know that Kafka set the default log directory /tmp/kafka-logs to store the logs and topics' content.

But system will clear the data in the /tmp when the machine reboot, so all the topics will disappear when I do that.

I have tried to make a new directory to store kafka-logs, like this /home/Kafka_Data, and chmod to 777.

Then modify the ~/confluent-5.5.1/etc/kafka/server.properties:

# log.dirs=/tmp/kafka-logs
log.dirs=/home/Kafka_Data/kafka-logs

The topic won't disappear anymore, but I can't start the Kafka's service after running the zookeeper.

So I want to ask that is there somewhere better to store the kafka-logs? Or the problem of this is not path, is related to Zookeeper's config?

The error which can't start the kafka server is below:

[2020-09-15 08:47:55,101] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient)
[2020-09-15 08:47:55,485] INFO Cluster ID = ZHT8XSrXSv-Ms6jPY8tB7w (kafka.server.KafkaServer)
[2020-09-15 08:47:55,532] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID ZHT8XSrXSv-Ms6jPY8tB7w doesn't match stored clusterId Some(bn11uRheTxeTyXnuhnxuog) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.
    at kafka.server.KafkaServer.startup(KafkaServer.scala:341)
    at io.confluent.support.metrics.SupportedServerStartable.startup(SupportedServerStartable.java:140)
    at io.confluent.support.metrics.SupportedKafka.main(SupportedKafka.java:66)
[2020-09-15 08:47:55,543] INFO shutting down (kafka.server.KafkaServer)
[2020-09-15 08:47:55,572] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
[2020-09-15 08:47:55,678] INFO EventThread shut down for session: 0x100000307690003 (org.apache.zookeeper.ClientCnxn)
[2020-09-15 08:47:55,679] INFO Session: 0x100000307690003 closed (org.apache.zookeeper.ZooKeeper)
[2020-09-15 08:47:55,681] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
[2020-09-15 08:47:55,690] INFO shut down completed (kafka.server.KafkaServer)
[2020-09-15 08:47:55,706] INFO Shutting down SupportedServerStartable (io.confluent.support.metrics.SupportedServerStartable)
[2020-09-15 08:47:55,707] INFO Closing BaseMetricsReporter (io.confluent.support.metrics.BaseMetricsReporter)
[2020-09-15 08:47:55,707] INFO Waiting for metrics thread to exit (io.confluent.support.metrics.SupportedServerStartable)
[2020-09-15 08:47:55,707] INFO Shutting down KafkaServer (io.confluent.support.metrics.SupportedServerStartable)
[2020-09-15 08:47:55,708] INFO shutting down (kafka.server.KafkaServer)
[2020-09-15 08:48:25,390] INFO Expiring session 0x100000307690001, timeout of 30000ms exceeded (org.apache.zookeeper.server.ZooKeeperServer)
Nelson
  • 1
  • 2

0 Answers0