Elasticsearch 8 Installation

In this article we will walk you through the installation process of Elasticsearch on both operating systems - Windows and Linux.

Note: The Elasticsearch version we will use is 8.5.3

Windows

Download:

The zip file can be downloaded directly from Elastic Group site using this link:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.5.3-windows-x86_64.zip

Installation:

  1. Download the zip file
  2. Extract elasticsearch folders to C:\Program Files\ELK\Elasticsearch (or any other folder)
  3. (optional) Open the elasticsearch.yml configuration file, in this example it will be located in C:\Program Files\ELK\Elasticsearch\config. Add the following row to enable auto creation for indexes:
    action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
    (In case you want use logstash soon, you can add their index pattern so indexes will be able to create automatically.
  4. Open CMD as administrator and go the elasticsearch folder using
    “cd C:\Program Files\ELK\Elasticsearch”
  5. Run elasticsearch using “.\bin\elasticsearch.bat”
  6. Usually when running elasticsearch for the first time, The following will be generated and displayed in the CMD:
    • Authentication and authorization are enabled, and a password is generated for the elastic built-in superuser.
    • Certificates and keys for TLS are generated for the transport and HTTP layer, and TLS is enabled and configured with these keys and certificates.
    • An enrollment token is generated for Kibana, which is valid for 30 minutes.
      In case you can’t see those you can create each of them manually using elastic sub-services.

Install as a service:

Once you finish all installation steps, you will be able to run Elasticsearch as a service.

  1. Open CMD as administrator and go the elasticsearch folder using
    “cd C:\Program Files\ELK\Elasticsearch”
  2. Install Elasticsearch service using “.\bin\elasticsearch-service.bat install”
    The service will be installed under the name ”elasticsearch-service-x64”
  3. Start Elasticsearch service using “.\bin\elasticsearch-service.bat start”
  4. In a different CMD, go to elastic search folder once again using the command from step 1, and run the following command to generate password for elastic superuser:
    “.\bin\elasticsearch-reset-password -u elastic”

Linux

Download:

First of all, open the terminal in the folder you would like to install later. In our case we will use /home/ELK as our installation folder. The download and extraction can be done from the terminal using the following commands:

				
					wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.6.1-linux-x86_64.tar.gz
				
			
				
					wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.6.1-linux-x86_64.tar.gz.sha512
				
			
				
					shasum -a 512 -c elasticsearch-8.6.1-linux-x86_64.tar.gz.sha512
				
			
				
					tar -xzf elasticsearch-8.6.1-linux-x86_64.tar.gz
				
			

Installation:

Once we finish the download and extraction we can start the installation.

  1. First, head to the elasticsearch extracted folder using:
    “cd elasticsearch-8.5.3” (might be different folder according the version downloaded)
  2. Edit the elasticsearch.yml file located in the config folder using “cat ./config/elasticsearch.yml”
    and add the following row to enable auto creation for indexes:
    action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
  3. Start Elasticsearch for the first time using “./bin/elasticsearch”
  4. Usually when running elasticsearch for the first time, The following will be generated and displayed in the terminal:
    • Authentication and authorization are enabled, and a password is generated for the elastic built-in superuser.
    • Certificates and keys for TLS are generated for the transport and HTTP layer, and TLS is enabled and configured with these keys and certificates.
    • An enrollment token is generated for Kibana, which is valid for 30 minutes.

Install as a service:

Once we finish the installation, we can install and run our Elasticsearch as a service.

  1. Run the following commands:
    sudo /bin/systemctl daemon-reload
    sudo /bin/systemctl enable elasticsearch.service
  2. In order to start elasticsearch as a service we must run the following:
    sudo systemctl start elasticsearch.service

Share:

More Posts

We Are Here For You :

Or fill in your details and we will contact you ASAP: