(I am new to elastic search)
I want to start the elastic search as a service (sudo systemctl start elasticsearch), but it won't start, and throw an error as given below in the image
So after that, I went through to log file of elasticsearch log at /var/log/elasticsearch/my-application.log
there I found some issues which is out of my range, The files attached below for error log is
https://filebin.net/ca3a5l67t2hqcexd
The piece of code I have tried so far
sudo apt-cache search openjdk
sudo apt-get install openjdk-11-jre openjdk-11-jdk
java -version (openjdk 14.0.1 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1) OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing))
sudo gedit /etc/environment
JAVA_HOME="/usr/lib/jvm/java-14-openjdk-amd64"
echo $JAVA_HOME (/usr/lib/jvm/java-14-openjdk-amd64)
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - (OK)
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list - (deb https://artifacts.elastic.co/packages/7.x/apt stable main)
sudo apt-get update && sudo apt-get install elasticsearch
sudo gedit /etc/elasticsearch/elasticsearch.yml
overwritted in yml file of elasticsearch
(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 systemctl start elasticsearch
I have also given permission as per suggested answer but still no success: https://stackoverflow.com/a/38539220/9427866
Any help will be appreciated!