简体   繁体   English

由于内存不足错误,无法在无所事事的Ubuntu框中启动Zookeeper服务器

[英]couldn't start zookeeper server in vagrant ubuntu box due to insufficient memory error

I've vagrant box with below ubuntu configurations. 我有下面的ubuntu配置的无家可归的盒子。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial

Below are the memory details - 以下是内存详细信息-

$ free -m
              total        used        free      shared  buff/cache   available
Mem:            488          43          92           1         351         414

I've downloaded the file kafka_2.12-1.1.1.tgz from here . 我从这里下载了文件kafka_2.12-1.1.1.tgz

Then I'm trying to start zookeeper server after extracting the archive using below command. 然后,我尝试使用以下命令提取存档后启动Zookeeper服务器。

$ sudo /home/vagrant/kafka/bin/zookeeper-server-start.sh  /home/vagrant/kafka/config/zookeeper.properties
Java HotSpot(TM) 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:
# /home/vagrant/hs_err_pid5404.log

I've provided the complete error log here . 我在这里提供了完整的错误日志。

I see always the vagrant machine has the swap space problem. 我看到总是无所事事的机器有交换空间问题。 How can I solve this problem and install successfully in vagrant machine. 我该如何解决这个问题并成功地在无业游民的机器上安装。

You will need to show your Vagrant file but the default VM memory space is not enough to start Zookeeper, let alone Kafka as well as Zookeeper. 您将需要显示Vagrant文​​件,但是默认的VM内存空间不足以启动Zookeeper,更不用说Kafka和Zookeeper。

Assuming your host machine has at least 4G of memory, you can take a look at the Vagrant + Ansible repo that I've forked from Confluent that by default, will start Zookeeper and Kafka on separate machines. 假设您的主机至少有4G内存,您可以看看我从Confluent分叉的Vagrant + Ansible存储库,默认情况下,它们将在单独的计算机上启动Zookeeper和Kafka。

https://github.com/cricket007/cp-ansible/blob/addVagrant/vagrant/README.md https://github.com/cricket007/cp-ansible/blob/addVagrant/vagrant/README.md

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM