启动kafka报错

执行启动kafka服务的命令时报错:nohup bin/kafka-server-start.sh config/server.properties 2>&1 &

[2019-07-28 12:58:44,760] ERROR [ReplicaManager broker=1] Error while making broker the follower for partition Topic: __consumer_offsets; Partition: 41; Leader: None; AssignedReplicas: ; InSyncReplicas:  in dir None (kafka.server.ReplicaManager)
org.apache.kafka.common.errors.KafkaStorageException: Error while reading checkpoint file /export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint
Caused by: java.io.IOException: Malformed line in checkpoint file (/export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint): ‘
 at kafka.server.checkpoints.CheckpointFile.malformedLineException$1(CheckpointFile.scala:84)
 at kafka.server.checkpoints.CheckpointFile.liftedTree2$1(CheckpointFile.scala:117)
 at kafka.server.checkpoints.CheckpointFile.read(CheckpointFile.scala:86)
 at kafka.server.checkpoints.OffsetCheckpointFile.read(OffsetCheckpointFile.scala:61)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:147)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:142)
 at kafka.utils.Pool.getAndMaybePut(Pool.scala:65)
 at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:141)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1227)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1204)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
 at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
 at scala.collection.mutable.HashMap.foreach(HashMap.scala:130)
 at kafka.server.ReplicaManager.makeFollowers(ReplicaManager.scala:1204)
 at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:1065)
 at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:173)
 at kafka.server.KafkaApis.handle(KafkaApis.scala:103)
 at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:65)
 at java.lang.Thread.run(Thread.java:748)
[2019-07-28 12:58:44,764] ERROR Error while reading checkpoint file /export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint (kafka.server.LogDirFailureChannel)
java.io.IOException: Malformed line in checkpoint file (/export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint): ‘
 at kafka.server.checkpoints.CheckpointFile.malformedLineException$1(CheckpointFile.scala:84)
 at kafka.server.checkpoints.CheckpointFile.liftedTree2$1(CheckpointFile.scala:117)
 at kafka.server.checkpoints.CheckpointFile.read(CheckpointFile.scala:86)
 at kafka.server.checkpoints.OffsetCheckpointFile.read(OffsetCheckpointFile.scala:61)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:147)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:142)
 at kafka.utils.Pool.getAndMaybePut(Pool.scala:65)
 at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:141)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1227)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1204)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
 at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
 at scala.collection.mutable.HashMap.foreach(HashMap.scala:130)
 at kafka.server.ReplicaManager.makeFollowers(ReplicaManager.scala:1204)
 at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:1065)
 at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:173)
 at kafka.server.KafkaApis.handle(KafkaApis.scala:103)
 at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:65)
 at java.lang.Thread.run(Thread.java:748)
[2019-07-28 12:58:44,765] ERROR [ReplicaManager broker=1] Error while making broker the follower for partition Topic: __consumer_offsets; Partition: 32; Leader: None; AssignedReplicas: ; InSyncReplicas:  in dir None (kafka.server.ReplicaManager)
org.apache.kafka.common.errors.KafkaStorageException: Error while reading checkpoint file /export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint
Caused by: java.io.IOException: Malformed line in checkpoint file (/export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint): ‘
 at kafka.server.checkpoints.CheckpointFile.malformedLineException$1(CheckpointFile.scala:84)
 at kafka.server.checkpoints.CheckpointFile.liftedTree2$1(CheckpointFile.scala:117)
 at kafka.server.checkpoints.CheckpointFile.read(CheckpointFile.scala:86)
 at kafka.server.checkpoints.OffsetCheckpointFile.read(OffsetCheckpointFile.scala:61)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:147)
 at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:142)
 at kafka.utils.Pool.getAndMaybePut(Pool.scala:65)
 at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:141)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1227)
 at kafka.server.ReplicaManager$$anonfun$makeFollowers$3.apply(ReplicaManager.scala:1204)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
 at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
 at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
 at scala.collection.mutable.HashMap.foreach(HashMap.scala:130)
 at kafka.server.ReplicaManager.makeFollowers(ReplicaManager.scala:1204)
 at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:1065)
 at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:173)
 at kafka.server.KafkaApis.handle(KafkaApis.scala:103)
 at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:65)
 at java.lang.Thread.run(Thread.java:748)
[2019-07-28 12:58:44,766] INFO [ReplicaFetcherManager on broker 1] Removed fetcher for partitions  (kafka.server.ReplicaFetcherManager)
[2019-07-28 12:58:44,774] INFO [ReplicaFetcherManager on broker 1] Added fetcher for partitions List() (kafka.server.ReplicaFetcherManager)
[2019-07-28 12:58:44,785] INFO [ReplicaManager broker=1] Partitions  are offline due to failure on log directory /export/servers/kafka_2.11-1.0.0/logs (kafka.server.ReplicaManager)
[2019-07-28 12:58:44,804] INFO [ReplicaFetcherManager on broker 1] Removed fetcher for partitions  (kafka.server.ReplicaFetcherManager)
[2019-07-28 12:58:44,812] INFO [ReplicaManager broker=1] Broker 1 stopped fetcher for partitions  because they are in the failed log dir /export/servers/kafka_2.11-1.0.0/logs (kafka.server.ReplicaManager)
[2019-07-28 12:58:44,820] INFO Stopping serving logs in dir /export/servers/kafka_2.11-1.0.0/logs (kafka.log.LogManager)
[2019-07-28 12:58:44,824] FATAL Shutdown broker because all log dirs in /export/servers/kafka_2.11-1.0.0/logs have failed (kafka.log.LogManager)

原因:kill -9 强制杀掉kafka进程,导致停止kafka时某些步骤没有处理,比如replication-offset-checkpoint文件没有处理好。

解决方法:备份/export/servers/kafka_2.11-1.0.0/logs/replication-offset-checkpoint文件,删掉该文件,然后重启kafka,就好了。

原文地址:https://www.cnblogs.com/mediocreWorld/p/11261357.html

时间: 2024-10-29 03:07:40

启动kafka报错的相关文章

首次启动Kafka报Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12)

首次启动Kafka报错如下: 原因:内存不足,查看启动配置 调小一些: 首次启动Kafka报Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12) 原文地址:https://www.cnblogs.com/zjfjava/p/10325523.html

spring boot 整合kafka 报错 Exception thrown when sending a message with key='null' and payload=JSON to topic proccess_trading_end: TimeoutException: Failed to update metadata after 60000 ms.

org.springframework.kafka.support.LoggingProducerListener- Exception thrown when sending a message with key='null' and payload='{"dataDts":["20180329","20180328","20180327","20180326","20180323"]

windows平台在tomcat中启动cas报错解决

windows平台在tomcat中启动cas报错: Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path, 系统找不到指定的路径.] 解决办法:将jansi.dll文件放到C:\Windows\System32目录下即可. 注意:jansi.dll文件在使用gradle编译打包cas时会下载到C:\Users\${用户名}\.gradle

436启动cman报错

rhel6.2启动cman报错 Waiting for quorum... Timed-out waiting for cluster 解决方法: 修改/etc/init.d/cman配置文件 vim /etc/init.d/cman CMAN_QUORUM_TIMEOUT=45 改为 CMAN_QUORUM_TIMEOUT=0 然后重启cman即可

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... Linux系统下装完MySQL,然后重启动时报错: 解决方法:  查看cat /etc/h

启动Myeclipse报错“Failed to create the Java Virtual Machine”的解决办法

我安装的是Myeclipse 10.7.1.装上好久没用,今天启动突然报错:Failed to create the Java Virtual Machine. 检查Myeclipse安装好使用时好的啊,近期也没用,可能是近期升级了本地单独安装的jre版本导致的吧(Myeclipse使用自己的jre的). 整理了如下2个解决办法,可以选择一个使用,我选择的是第2个.经测试都ok. 方法一: 找到Myeclpise路径下的myeclipse.ini文件: 编辑将Xmx(JVM Heap最大允许的尺

ceph升级到10.2.3 版本启动服务报错:Unknown lvalue 'TasksMax' in section 'Service'

#### ceph软件包升级完成,执行命令重启服务 sudo systemctl restart [email protected]"$HOSTNAME" #### 故障现象 服务可以启动,启动后显示有报错信息: Nov 23 17:14:45 ceph-6-12 systemd[1]:        [/usr/lib/systemd/system/[email protected]:18] Unknown lvalue 'TasksMax' in section 'Service'

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with

Linux系统下启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with 摘要 Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... Linux系统下装完MySQL,然后重新启动动时报错: 解决方法:  查看cat /etc

启动httpd报错-已解决

[[email protected] ~]# service httpd startStarting httpd: (13)Permission denied: make_sock: could not bind to address 192.168.1.153:28080no listening sockets available, shutting downUnable to open logs [FAILED][[email protected] ~]# 临时办法: [[email pro