Installation

Installation of Elasticsearch 7.x on Windows

Introduction

This document provides a detailed guide for installing and configuring Elasticsearch in a Windows environment. It includes step-by-step instructions for the installation process, configuration settings, and integration with the OvalEdge (OE) application.

Prerequisites

  1. The user must have Admin access to the server
  2. Elasticsearch port 9200 should be enabled

Elasticsearch Server Installation

  1. Download the Elasticsearch 7.17.x installer for Windows from the following link:
    Elasticsearch 7.17.21 for Windows
  2. Extract the contents of the downloaded archive to a directory on the Windows Server. 

    For example, extract it to C:\elasticsearch\elasticsearch-7.17.21-windows-x86_64\.

  3. Open a command prompt as an administrator and navigate to the Elasticsearch bin directory. 

    For example, navigate to C:\elasticsearch\elasticsearch-7.17.21-windows-x86_64\elasticsearch-7.17.21\bin.

Expose Elasticsearch as a Service

  1. Run the command "elasticsearch-service.bat install" to install/expose Elasticsearch as a Windows service.
  2. Go to the Installed Elasticsearch Bin folder and run the command

    FYI:

    C:\elasticsearch\elasticsearch-7.17.21-windows-x86_64\elasticsearch-7.17.21\bin

Set up Heap size for Elasticsearch

  1. For efficient elastic search heap allocation(to run elasticsearch smoothly), we recommend using the following JVM settings: Xms5g -Xmx5g. 
  2. Go to the elasticsearch installation folder(conf), copy jvm.options file, and place it in jvm.options.d folder. 

  3. Open jvm.options file present in jvm.options.d folder and search for values like -Xms and -Xmx.
  4. If it's commented, uncomment it and change the value to -Xms4g -Xmx4g.

  5. Open the Elasticsearch configuration file located at C:\elasticsearch\elasticsearch-7.17.21-windows-x86_64\elasticsearch-7.17.21\config\elasticsearch.yml in a text editor.
  6. Configure Elasticsearch by setting the following parameters in the configuration file: add the following lines in the yaml file.

  7. Save the configuration file and close the text editor.

Start Elasticsearch as a Service

  1. To start the Elasticsearch service, navigate to C:\elasticsearch\elasticsearch-7.17.21-windows-x86_64\elasticsearch-7.17.21\bin path and run the command: net start elasticsearch-service-x64

  2. Enable authentication to Elasticsearch by setting a password to the elastic user.
  3. To set the Password for Elasticsearch, run the following command >> go to bin folder > open cmd >> type the following command:
    elasticsearch-setup-passwords.bat interactive

  4. Provide the same password to all the other users that are prompted for and store the password for the future.
  5. Restart Elasticsearch and integrate it with OE applications.

Integrating Elasticsearch with OvalEdge

  1. Navigate to the oasis.properties in c:\ovaledge\ext-prop\ 
  2. Provide Elasticsearch credentials set up while installing the Elasticsearch application, as shown below.
  3. After updating the ES details, restart the Tomcat service to reflect the changes. 

Run OvalEdge 

  1. Restart the Tomcat (if the Tomcat is already running)
  2. Restart the Elasticsearch Server.
  3. Enter the http://<PublicIP>:8080/ovaledge in the web browser. The OvalEdge License Information page is displayed.
  4. With the help of the admin credentials, log in to the application and change the default password that was generated while updating the license information. 

Elasticsearch Verification

To confirm whether Elasticsearch is integrated or not, on the OvalEdge Home page, enter the text in the search bar and hit enter. The Global Search results page appears. 

Upgrade Elasticsearch

Pre-Upgrade Steps

  1. Login to the Elasticsearch Server:
    • Access the server where Elasticsearch is installed.
  2. Stop Elasticsearch Service:
    • Open Services (services.msc) on the server.
    • Locate the Elasticsearch service.
    • Stop the service as shown in the example screenshot.
  3. Backup Important Configuration Files:
    • Navigate to the Elasticsearch installation directory (e.g., C:\Elasticsearch\config).
    • Take a backup of the following files:
      • elasticsearch.yml
      • jvm.options
    • Save these files in a secure location for reference.
  4. Remove the Existing Service:
    • Navigate to the bin folder in the Elasticsearch installation directory (e.g., C:\Elasticsearch\bin).
    • Run the following command in a command prompt to remove the service:
      elasticsearch-service.bat remove

Upgrade Elasticsearch

  1. Download Elasticsearch 7.17.26:
  2. Extract the Downloaded ZIP File:
    • Extract the downloaded ZIP file to a new directory (e.g., C:\Elasticsearch-7.17.26).
  3. Update Configurations:
    • Copy the configurations elasticsearch.yml and jvm.options parameters backed up previously to the config folder of the new Elasticsearch installation directory (C:\Elasticsearch-7.17.26\config).
    • Ensure all necessary settings from the old configuration are updated in the new configuration files.

Post-Upgrade Steps

  1. Install the Elasticsearch Service:
    • Open a command prompt with administrative privileges.
    • Navigate to the bin folder of the new Elasticsearch installation directory:
      cd C:\Elasticsearch-7.17.26\bin
    • Run the following command to install the service:
      elasticsearch-service.bat install
  2. Start Elasticsearch Service:
    • Open Services (services.msc).
    • Locate the newly created Elasticsearch service.
    • Start the service.
  3. Generate Elasticsearch Passwords:
    • Open a command prompt and navigate to the bin folder of the Elasticsearch installation directory.
    • Run the following command to set up passwords interactively:
      elasticsearch-setup-passwords interactive
    • Follow the prompts to generate and secure passwords for Elasticsearch.

Verification

  1. Verify the Elasticsearch Version:
    • Open a command prompt and run:
      curl -X GET "http://localhost:9200"
    • Ensure the response indicates version 7.17.26.

This process ensures a smooth and secure upgrade to Elasticsearch 7.17.26. 


Copyright © 2024, OvalEdge LLC, Peachtree Corners, GA USA