一、启动kafka broker时异常
nohup /mnt/sata1/kafka_2.11-0.10.0.1/bin/kafka-server-start.sh /mnt/sata1/kafka_2.11-0.10.0.1/config/server.properties &
异常:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12)
二、解决方法 进入/mnt/sata1/kafka_2.11-0.10.0.1/bin目录下,修改kafka-server-start.sh文件:
找到这一行export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
改为 export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"
|