kafka集群环境搭建

时间:2020-12-22 12:10:44

下载地址:

Error: Could not find or load main class kafka.Kafka

2、启动kafka的时候,如发现,有节点启动不起来,并出现如下错误信息

Java HotSpot(TM) Server VM warning: INFO: os::commit_memory(0x67e00000, 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...

则说明kafka启动时,jvm所需内存配置超过了系统内存,因为Kafka默认使用-Xmx1G -Xms1G的JVM内存配置,如果机器内存较小,需要调整启动配置,按如下调整
vim bin/kafka-server-start.sh;
修改KAFKA_HEAP_OPTS的值,如下
kafka集群环境搭建

因为本人系统内存分配的大小刚好是1G,所以每次只能启动一个kafka 节点,修改申请大小就好了