Elasticsearch has been developed using Java Programming language. So Java has to be installed on your computer to install Elasticsearch. You can check the Java version using the following command.
java -version
If Java is not installed you can install it using the following command.
sudo apt-get install openjdk-8-jdk
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
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
Uncomment and change network.host to localhost and uncomment http.port:
network.host: localhost
http.port: 9200
sudo systemctl start elasticsearch
sudo systemctl status elasticsearch
sudo systemctl stop elasticsearch
sudo systemctl restart elasticsearch
sudo systemctl enable elasticsearch.service
curl -X GET http://localhost:9200
You will get the following output:
{
"name" : "mamun",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "WGNg0KLfRMaEye9EVZXOWg",
"version" : {
"number" : "7.12.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "78722783c38caa25a70982b5b042074cde5d3b3a",
"build_date" : "2021-03-18T06:17:15.410153305Z",
"build_snapshot" : false,
"lucene_version" : "8.8.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}