1、启动Kafka出现以下错误:
[root@hadoop01 kafka_2.13-2.6.0]# ./bin/kafka-server-start.sh config/server.properties
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /opt/kafka_2.13-2.6.0/hs_err_pid21451.log
2、问题
启动时报错,大概意思是内存不足。
3、解决方案
# 修改前
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
# 修改后
export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"。