as you can see from the log, you don't have enough memory to run full stack. you have 2 options:
- run ELK from AWS service
- 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 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 !!!