0

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

3

2 Answers 2

1

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

https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html

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:

0

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
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
echo $JAVA_HOME
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: []
network.host: 127.0.0.1
http.port: 9200
cluster.initial_master_nodes: 127.0.0.1

sudo journalctl -xe

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

Hope this solves your issue !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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