1.具体报错信息

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e0000000, 536870912, 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 536870912 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/local/kafka/kafka_2.11-2.2.0/hs_err_pid2045.log

2.报错截图

3.发现是内存太小,所以我们修改配置文件的启动限制大小

3.1.  修改bin目录下的kafka-server-start.sh文件   修改初始堆大小:-Xms  设置小一些

 

修改为:

3.2.修改bin目录下的 zookeeper-server-start.sh,  修改初始堆大小:-Xms  设置小一些

 

修改为:

4.再次启动:发现启动正常

Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐