启用G1GC垃圾收集器

问题描述 投票:0回答:1

我正在尝试在 Jetson Nano(aarch64 架构)中安装 Kafka,但在安装过程中遇到了一些问题。

我正在按照 Kafka 安装教程(Kafka 快速入门指南)的步骤以及执行命令时

bin/zookeeper-server-start.sh config/zookeeper.properties

它向我显示了以下结果: enter image description here

如何启用此虚拟机选项?

java garbage-collection apache-zookeeper g1gc
1个回答
0
投票

我找到了运行zookzeeper时出现此错误的解决方案

Here is step 
1)Locate the start script of zookeeper under the bin folder of kafka
2)Open the file
3)Locate the below code in the file

if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
    export KAFKA_HEAP_OPTS="-Xmx512M -Xms512M"

4) Replace the step 3 code with below one

if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
    KAFKA_HEAP_OPTS="-Xmx512M -Xms512M"
    # Add the required JVM options
    export KAFKA_HEAP_OPTS="$KAFKA_HEAP_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC"
The error has gone next time when u run this command. 
Note : If you facing issue while running zookeeper , kafka or topic . You can use this code and replace it with respective start script Let me know if you face any issue
© www.soinside.com 2019 - 2024. All rights reserved.