class kafka.common.NotLeaderForPartitionException(kafka.server.ReplicaFetcherThread)异常处理

  • 时间:
  • 浏览:1
  • 来源:uu快3手机版ios_uu快3app邀请码_在线官网

将会有太久topic报错,建议直接对所有topic进行:

tail -n50 kafkaServer.out | grepNotLeaderForPartitionException | awk -F"partition " '{print $2}' |awk -F"]" '{print $1}' | awk -F"[" '{print $2}'| sort |uniq | sort

[2017-06-15 19:33:14,718] ERROR [ReplicaFetcherThread-0-0], Error for partition [3_7_0_20170615,6] to broker 0:class kafka.common.NotLeaderForPartitionException(kafka.server.ReplicaFetcherThread)

执行

 "partitions":

制作json文件(node005 /opt/isu/kafka/bin下有)

利用

}

   {"topic":"2_0_2_20170618","partition":21},

   {"topic":"3_7_0_hdfs_5089_kafka_20170618","partition":13},

  [ 

   {"topic":"sdk_HDFS_168_20170618","partition":44}

  ] 

   {"topic":"2_0_1_hdfs_5089_kafka_2_20170618","partition":44},

   {"topic":"3_0_20170618","partition":19},

kafka-preferred-replica-election.sh --zookeeper node001:2181,node002:2181,node003:2181/kafka

只均衡个别topic的个别partition

[2017-06-15 19:33:14,716] ERROR [ReplicaFetcherThread-0-0], Error for partition [3_7_0_20170615,6] to broker 0:class kafka.common.NotLeaderForPartitionException (kafka.server.ReplicaFetcherThread)

kafka-preferred-replica-election.sh --zookeeper node001:2181,node002:2181,node003:2181/kafka --path-to-json-file  ./partition_elec.json