DevOps Classroomnotes 08/Jul/2022

Installing Elastic Search

Scenario 1: Installing Elastic Search on ubuntu 20.04

  • Refer Here for the official documentation.
  • We would be installing from package manager Refer Here
  • Refer Here for support matrix of elastic search, kibana, logstash and beat
  • On Ubuntu
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
sudo apt-get install apt-transport-https
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt-get update && sudo apt-get install elasticsearch
  • The installation gives us following information
--------------------------- Security autoconfiguration information ------------------------------

Authentication and authorization are enabled.
TLS for the transport and HTTP layers is enabled and configured.

The generated password for the elastic built-in superuser is : LJGveyix-ey-+bsvdGvC

If this node should join an existing cluster, you can reconfigure this with
'/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <token-here>'
after creating an enrollment token on your existing cluster.

You can complete the following actions at any time:

Reset the password of the elastic built-in superuser with
'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.

Generate an enrollment token for Kibana instances with
 '/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'.

Generate an enrollment token for Elasticsearch nodes with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node'.

-------------------------------------------------------------------------------------------------
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
  • The major locations:
    • /usr/share/elasticsearch => installation of files is done
    • /etc/elasticsearch => configuration of elastic search
  • Elastic search installation configurations are by default configured to be accesible from the same machine (loopback)
  • Now change the network host with private ip and discovery.seed_hosts with private ip as discussed in the classroom in the file /etc/elasticsearch/elasticsearch.yml. Then execute the below commands
    Preview
  • Elastic search works on port 9200 by default
  • To view the logs of elastic search sudo journalctl --unit elasticsearch
  • Elastic search 8+ is secure by default access by https://<publicip&gt;:9200 and enter credentials
    Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner