OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed;...

使用docker 安装kafka时启动失败

1155330-20190715154319779-1681801176.png

查看报错日志

# docker logs --since 30m 71846a96e514
Excluding KAFKA_HOME from broker config
[Configuring] 'port' in '/opt/kafka/config/server.properties'
[Configuring] 'advertised.listeners' in '/opt/kafka/config/server.properties'
[Configuring] 'broker.id' in '/opt/kafka/config/server.properties'
Excluding KAFKA_VERSION from broker config
[Configuring] 'listeners' in '/opt/kafka/config/server.properties'
[Configuring] 'zookeeper.connect' in '/opt/kafka/config/server.properties'
[Configuring] 'log.dirs' in '/opt/kafka/config/server.properties'
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Out of memory' (errno=12)

查看内存使用情况

# free -m

1155330-20190715154607972-678106262.png

创建swapfile

# dd  if=/dev/zero  of=swapfile  bs=1024  count=500000  
count=空间大小 of空间名字

将swapfile设置为swap空间

# mkswap swapfile

启用交换空间,这个操作有点类似于mount操作

# swapon  swapfile (删除交换空间 swapoff swapfile)

至此增加交换空间的操作结束了,可以使用free命令查看swap空间大小是否发生变化
1155330-20190715154957213-451288053.png
kafka 安装成功~
1155330-20190715155018282-934521875.png

参考博客:https://www.cnblogs.com/wang-yaz/p/9395005.html

转载于:https://www.cnblogs.com/liuyupen/p/11189363.html

你可能感兴趣的:(OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed;...)