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
- The user must have Admin access to the server
- Elasticsearch port 9200 should be enabled
Elasticsearch Server Installation
- Download the Elasticsearch 7.17.x installer for Windows from the following link:
Elasticsearch 7.17.21 for Windows - 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\.
- 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
- Run the command "elasticsearch-service.bat install" to install/expose Elasticsearch as a Windows service.
- 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
- For efficient elastic search heap allocation(to run elasticsearch smoothly), we recommend using the following JVM settings: Xms5g -Xmx5g.
- Go to the elasticsearch installation folder(conf), copy jvm.options file, and place it in jvm.options.d folder.
- Open jvm.options file present in jvm.options.d folder and search for values like -Xms and -Xmx.
- If it's commented, uncomment it and change the value to -Xms4g -Xmx4g.
- 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.
- Configure Elasticsearch by setting the following parameters in the configuration file: add the following lines in the yaml file.
- Save the configuration file and close the text editor.
Start Elasticsearch as a Service
- 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
- Enable authentication to Elasticsearch by setting a password to the elastic user.
- 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 - Provide the same password to all the other users that are prompted for and store the password for the future.
- Restart Elasticsearch and integrate it with OE applications.
Integrating Elasticsearch with OvalEdge
- Navigate to the oasis.properties in c:\ovaledge\ext-prop\
- Provide Elasticsearch credentials set up while installing the Elasticsearch application, as shown below.
- After updating the ES details, restart the Tomcat service to reflect the changes.
Run OvalEdge
- Restart the Tomcat (if the Tomcat is already running)
- Restart the Elasticsearch Server.
- Enter the http://<PublicIP>:8080/ovaledge in the web browser. The OvalEdge License Information page is displayed.
- 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
- Login to the Elasticsearch Server:
- Access the server where Elasticsearch is installed.
- Stop Elasticsearch Service:
- Open Services (services.msc) on the server.
- Locate the Elasticsearch service.
- Stop the service as shown in the example screenshot.
- 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.
- 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
- Download Elasticsearch 7.17.26:
- Visit the official download link: Elasticsearch 7.17.26
- Direct download link for the Windows ZIP file: Elasticsearch 7.17.26 ZIP
- Extract the Downloaded ZIP File:
- Extract the downloaded ZIP file to a new directory (e.g., C:\Elasticsearch-7.17.26).
- Extract the downloaded ZIP file to a new directory (e.g., C:\Elasticsearch-7.17.26).
- 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
- 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
- Start Elasticsearch Service:
- Open Services (services.msc).
- Locate the newly created Elasticsearch service.
- Start the service.
- 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
- Verify the Elasticsearch Version:
- Open a command prompt and run:
curl -X GET "http://localhost:9200" - Ensure the response indicates version 7.17.26.
- Open a command prompt and run:
This process ensures a smooth and secure upgrade to Elasticsearch 7.17.26.
Copyright © 2024, OvalEdge LLC, Peachtree Corners, GA USA