Use the following command to download the debian file for the Ubuntu OS

For Automatically installation:-

  • wget -qO – | sudo apt-key add –
  • sudo apt-get install apt-transport-https
  • echo “deb stable main” | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
  • sudo apt-get update && sudo apt-get install elasticsearch

For Manually Installation:-

  • wget
  • sudo dpkg -i elasticsearch-7.12.1-amd64.deb

Configuration File

  • Use the following command for Configure the to the localhost
    • sudo nano /etc/elasticsearch/elasticsearch.yml
  • For automatically start the elasticsearch when system reboot
    • sudo update-rc.d elasticsearch defaults 95 10
  • Use the following command for Start and enable the elasticsearch services
    • sudo -i service elasticsearch start
    • sudo -i service elasticsearch stop
  • To run the Elasticsearch with the systemd
    • sudo /bin/systemctl daemon-reload
    • sudo /bin/systemctl enable elasticsearch.service
    • sudo systemctl start elasticsearch.service
    • sudo systemctl stop elasticsearch.service
    • sudo systemctl status elasticsearch.service
  • Getting error while starting the elasticsearch
    • First restart the machine or your ubuntu OS. If issue resolve than OK else use the below command to get the exact error.
    • journalctl -xe
  • If error is “Out of memory” than use the below command and change the heap space -Xms128m and Xmx128m
    • sudo nano /etc/elasticsearch/jvm.options
  • Port number for the elasticsearch is 9200.
  • ElasticSearch deployed path:-
    • /etc/elasticsearch
  • Path for the log file of ElasticSearch
    • /var/log/elasticsearch
  • Path for starting the ElasticSearch
    • sudo /etc/init.d/elasticsearch start