gpt4 book ai didi

Java 堆空间 - 内存不足错误 - 带有 SASL_SSL 的 Kafka Broker

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:56 24 4
gpt4 key购买 nike

当我在带有 PLAIN_TEXT 端口 9092 的 Kafka 代理中使用下面的“/usr/bin/kafka-delete-records”命令时,该命令工作正常,但是当我使用 SASL_SSL 端口 9094 时,该命令抛出以下错误.有人知道通过 SASL_SSL 使用 Kafka 代理端口 9094 的解决方案吗?

$ssh **** ****@<IP address> /usr/bin/kafka-delete-records --bootstrap-server localhost:9094 --offset-json-file /kafka/records.json`

[2019-10-14 04:15:49,891] ERROR Uncaught exception in thread 'kafka-admin-client-thread | adminclient-1': (org.apache.kafka.common.utils.KafkaThread)

java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
at org.apache.kafka.common.memory.MemoryPool$1.tryAllocate(MemoryPool.java:30)
at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:112)
at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:390)
at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:351)
at org.apache.kafka.common.network.Selector.attemptRead(Selector.java:609)
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:541)
at org.apache.kafka.common.network.Selector.poll(Selector.java:467)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:535)
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1125)
at java.lang.Thread.run(Thread.java:748)
Executing records delete operation
Records delete operation completed:

注意:-Xmx 为 8GB,服务器的总内存为 16GB

请检查下面的当前堆值:

$ ps -ef | grep kafka
cp-kafka 11419 1 3 10:07 ? 00:05:27 java -Xms8g -Xmx8g -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 ........ io.confluent.support.metrics.SupportedKafka /etc/kafka/server.properties

最佳答案

很可能,OOM 异常只是一个转移注意力的问题,请参阅 JIRA KAFKA-4493 .真正的问题是 SASL-SSL 连接,您的客户端无法正确建立该连接。在客户端启用 SSL 调试并从那里继续:

$ export KAFKA_OPTS="-Djavax.net.debug=handshake"
$ /usr/bin/kafka-delete-records ...

关于Java 堆空间 - 内存不足错误 - 带有 SASL_SSL 的 Kafka Broker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58375592/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com