kafka启动:Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memor

错误信息如下:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (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:
# /usr/local/src/kafka_2.10-0.10.0.1/bin/hs_err_pid5584.log

错误原因: 

Kafka默认使用-Xmx1G -Xms1G的JVM内存配置,如果机器内存较小,需要调整启动配置。 


解决办法:

打开/config/kafka-server-start.sh,修改 
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" 
为适合当前服务器的配置,例如export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"

你可能感兴趣的:(大数据)