I installed elastic search, but when i run start command to run elastic search it will give errorenter image description here, and there is no error in log files in /var/log/elasticsearch

enter image description here

I am adding log files also, and i am using aws ubuntu 20.04 t2.micro enter image description here

enter image description here


as you can see from the log, you don't have enough memory to run full stack. you have 2 options:

  1. run ELK from AWS service
  2. get bigger instance or set memory limits for ELK stack


Setting the heap size:

By default, Elasticsearch tells the JVM to use a heap with a minimum and maximum size of 1 GB. When moving to production, it is important to configure heap size to ensure that Elasticsearch has enough heap available.

Elasticsearch will assign the entire heap specified in jvm.options via the Xms (minimum heap size) and Xmx (maximum heap size) settings. You should set these two settings to be equal to each other.

The value for these settings depends on the amount of RAM available on your server:


I have tried this for Ubuntu 20.04

sudo apt-cache search openjdk
sudo apt-get install openjdk-11-jre openjdk-11-jdk
java -version
sudo gedit /etc/environment
sudo curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - (OK)
sudo echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list  
sudo apt-get update && sudo apt-get install elasticsearch
sudo gedit /etc/elasticsearch/elasticsearch.yml

cluster.name: my-application
node.name: magentocom
network.publish_host: localhost
discovery.seed_hosts: []
http.port: 9200

sudo journalctl -xe

sudo systemctl start elasticsearch
sudo systemctl status elasticsearch
curl -XGET 'http://localhost:9200'
curl http://localhost:9200/_cluster/health?pretty

Hope this solves your issue !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.