Kafka服务隔几天就卡死一次 kill-9之后 重启又能恢复 麻烦各位大佬看看是啥原因

李呲花 发表于: 2024-12-19   最后更新时间: 2024-12-19 14:37:59   29 游览

Kafka服务隔几天就卡死一次 kill-9之后 重启能恢复正常 过几天又不行了

麻烦各位大佬看看是啥原因,看看是性能问题还是网络问题还是啥别的

版本kafka3.0.0,用的自带的zookeeper,数据量不小,每个主题保存了5G,大概最多几个小时的数据

用了自带的sasl-plaintext鉴权,单服务器单节点

配置:

broker.id=0
listeners=LOCAL://xxx:9092,JTKG://xxx:9093,GDKJ://xxx:9094  # 跨网所以映射了多个,这里的xxx代表同一个ip
advertised.listeners=LOCAL://xxx:9092,JTKG://yyy:9093,GDKJ://zzz:29092  # xxx,yyy,zzz是不同ip
listener.security.protocol.map=LOCAL:SASL_PLAINTEXT,JTKG:SASL_PLAINTEXT,GDKJ:SASL_PLAINTEXT
inter.broker.listener.name=LOCAL
sasl.enabled.mechanisms=SCRAM-SHA-256
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
authorizer.class.name=kafka.security.authorizer.AclAuthorizer
super.users=User:admin
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=1024000
socket.receive.buffer.bytes=1024000
socket.request.max.bytes=104857600
log.dirs=/home/kafka/kafka_2.12-3.0.0/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.retention.bytes=5368709120
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=60000
group.initial.rebalance.delay.ms=0

下为最近一次日志

[2024-12-19 13:14:25,486] DEBUG [Controller id=0] Resigning (kafka.controller.KafkaController)
[2024-12-19 13:14:25,940] DEBUG [Controller id=0] Unregister BrokerModifications handler for Set() (kafka.controller.KafkaController)
[2024-12-19 13:14:26,058] INFO [PartitionStateMachine controllerId=0] Stopped partition state machine (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:26,136] INFO [ReplicaStateMachine controllerId=0] Stopped replica state machine (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:26,677] INFO [Controller id=0] Resigned (kafka.controller.KafkaController)
[2024-12-19 13:14:26,760] DEBUG [Controller id=0] Resigning (kafka.controller.KafkaController)
[2024-12-19 13:14:26,760] DEBUG [Controller id=0] Unregister BrokerModifications handler for Set() (kafka.controller.KafkaController)
[2024-12-19 13:14:26,760] INFO [PartitionStateMachine controllerId=0] Stopped partition state machine (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:26,760] INFO [ReplicaStateMachine controllerId=0] Stopped replica state machine (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:26,760] INFO [Controller id=0] Resigned (kafka.controller.KafkaController)
[2024-12-19 13:14:29,817] INFO [Controller id=0] 0 successfully elected as the controller. Epoch incremented to 60 and epoch zk version is now 60 (kafka.controller.KafkaController)
[2024-12-19 13:14:30,134] INFO [Controller id=0] Registering handlers (kafka.controller.KafkaController)
[2024-12-19 13:14:30,165] INFO [Controller id=0] Deleting log dir event notifications (kafka.controller.KafkaController)
[2024-12-19 13:14:30,207] INFO [Controller id=0] Deleting isr change notifications (kafka.controller.KafkaController)
[2024-12-19 13:14:30,209] INFO [Controller id=0] Initializing controller context (kafka.controller.KafkaController)
[2024-12-19 13:14:30,556] INFO [Controller id=0] Initialized broker epochs cache: Map(0 -> 5125) (kafka.controller.KafkaController)
[2024-12-19 13:14:30,910] DEBUG [Controller id=0] Register BrokerModifications handler for Set(0) (kafka.controller.KafkaController)
[2024-12-19 13:14:31,219] DEBUG [Channel manager on controller 0]: Controller 0 trying to connect to broker 0 (kafka.controller.ControllerChannelManager)
[2024-12-19 13:14:31,281] INFO [RequestSendThread controllerId=0] Starting (kafka.controller.RequestSendThread)
[2024-12-19 13:14:31,282] INFO [Controller id=0] Currently active brokers in the cluster: Set(0) (kafka.controller.KafkaController)
[2024-12-19 13:14:31,283] INFO [Controller id=0] Currently shutting brokers in the cluster: Set() (kafka.controller.KafkaController)
[2024-12-19 13:14:31,283] INFO [Controller id=0] Current list of topics in the cluster: Set(xxx) (kafka.controller.KafkaController)
[2024-12-19 13:14:31,284] INFO [Controller id=0] Fetching topic deletions in progress (kafka.controller.KafkaController)
[2024-12-19 13:14:31,364] INFO [Controller id=0] List of topics to be deleted:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,364] INFO [Controller id=0] List of topics ineligible for deletion:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,364] INFO [Controller id=0] Initializing topic deletion manager (kafka.controller.KafkaController)
[2024-12-19 13:14:31,384] INFO [Topic Deletion Manager 0] Initializing manager with initial deletions: Set(), initial ineligible deletions: Set() (kafka.controller.TopicDeletionManager)
[2024-12-19 13:14:31,399] INFO [Controller id=0] Sending update metadata request (kafka.controller.KafkaController)
[2024-12-19 13:14:31,510] INFO [ReplicaStateMachine controllerId=0] Initializing replica state (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:31,519] INFO [ReplicaStateMachine controllerId=0] Triggering online replica state changes (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:31,558] INFO [RequestSendThread controllerId=0] Controller 0 connected to x'x'xxxx:9092 (id: 0 rack: null) for sending state change requests (kafka.controller.RequestSendThread)
[2024-12-19 13:14:31,673] INFO [ReplicaStateMachine controllerId=0] Triggering offline replica state changes (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:31,674] DEBUG [ReplicaStateMachine controllerId=0] Started replica state machine with initial state -> Map(xxx) (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:31,675] INFO [PartitionStateMachine controllerId=0] Initializing partition state (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:31,677] INFO [PartitionStateMachine controllerId=0] Triggering online partition state changes (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:31,679] DEBUG [PartitionStateMachine controllerId=0] Started partition state machine with initial state -> Map(xxxxxxx) (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:31,679] INFO [Controller id=0] Ready to serve as the new controller with epoch 60 (kafka.controller.KafkaController)
[2024-12-19 13:14:31,683] INFO [Controller id=0] Partitions undergoing preferred replica election:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,683] INFO [Controller id=0] Partitions that completed preferred replica election:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,692] INFO [Controller id=0] Skipping preferred replica election for partitions due to topic deletion:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,692] INFO [Controller id=0] Resuming preferred replica election for partitions:  (kafka.controller.KafkaController)
[2024-12-19 13:14:31,693] INFO [Controller id=0] Starting replica leader election (PREFERRED) for partitions  triggered by ZkTriggered (kafka.controller.KafkaController)
[2024-12-19 13:14:31,823] INFO [Controller id=0] Starting the controller scheduler (kafka.controller.KafkaController)
[2024-12-19 13:14:31,847] DEBUG [Controller id=0] Resigning (kafka.controller.KafkaController)
[2024-12-19 13:14:31,847] DEBUG [Controller id=0] Unregister BrokerModifications handler for Set(0) (kafka.controller.KafkaController)
[2024-12-19 13:14:31,859] INFO [PartitionStateMachine controllerId=0] Stopped partition state machine (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:31,859] INFO [ReplicaStateMachine controllerId=0] Stopped replica state machine (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:32,002] INFO [RequestSendThread controllerId=0] Shutting down (kafka.controller.RequestSendThread)
[2024-12-19 13:14:32,051] WARN [RequestSendThread controllerId=0] Controller 0 epoch 60 fails to send request (xxx) to broker xxx:9092 (id: 0 rack: null). Reconnecting to broker. (kafka.controller.RequestSendThread)
java.io.IOException: Client was shutdown before response was read
    at org.apache.kafka.clients.NetworkClientUtils.sendAndReceive(NetworkClientUtils.java:109)
    at kafka.controller.RequestSendThread.doWork(ControllerChannelManager.scala:252)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:96)
[2024-12-19 13:14:32,070] ERROR [RequestSendThread controllerId=0] Controller 0 fails to send a request to broker xxx:9092 (id: 0 rack: null) (kafka.controller.RequestSendThread)
java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
    at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277)
    at kafka.utils.ShutdownableThread.pause(ShutdownableThread.scala:82)
    at kafka.controller.RequestSendThread.backoff$1(ControllerChannelManager.scala:233)
    at kafka.controller.RequestSendThread.doWork(ControllerChannelManager.scala:261)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:96)
[2024-12-19 13:14:32,071] INFO [RequestSendThread controllerId=0] Stopped (kafka.controller.RequestSendThread)
[2024-12-19 13:14:32,076] INFO [RequestSendThread controllerId=0] Shutdown completed (kafka.controller.RequestSendThread)
[2024-12-19 13:14:32,146] INFO [Controller id=0] Resigned (kafka.controller.KafkaController)
[2024-12-19 13:14:32,316] DEBUG [Controller id=0] Broker 0 has been elected as the controller, so stopping the election process. (kafka.controller.KafkaController)
[2024-12-19 13:14:51,582] INFO [ControllerEventThread controllerId=0] Shutting down (kafka.controller.ControllerEventManager$ControllerEventThread)
[2024-12-19 13:14:51,582] INFO [ControllerEventThread controllerId=0] Stopped (kafka.controller.ControllerEventManager$ControllerEventThread)
[2024-12-19 13:14:51,582] INFO [ControllerEventThread controllerId=0] Shutdown completed (kafka.controller.ControllerEventManager$ControllerEventThread)
[2024-12-19 13:14:51,583] DEBUG [Controller id=0] Resigning (kafka.controller.KafkaController)
[2024-12-19 13:14:51,583] DEBUG [Controller id=0] Unregister BrokerModifications handler for Set() (kafka.controller.KafkaController)
[2024-12-19 13:14:51,583] INFO [PartitionStateMachine controllerId=0] Stopped partition state machine (kafka.controller.ZkPartitionStateMachine)
[2024-12-19 13:14:51,583] INFO [ReplicaStateMachine controllerId=0] Stopped replica state machine (kafka.controller.ZkReplicaStateMachine)
[2024-12-19 13:14:51,583] INFO [Controller id=0] Resigned (kafka.controller.KafkaController)
添加评论
你的答案

查看kafka相关的其他问题或提一个您自己的问题