TABLE OF CONTENTS
- Introduction
- Prerequisite
- Java JDK Configuration
- Steps to install Elasticsearch 8.8.1 version on the local machine :
Introduction
This article guides you in installing the version of Elasticsearch 8.8.1 on the local/server machine.
Prerequisite
The Elasticsearch 8.8.1 version has a dependency on the JDK LTS version.
Java JDK Configuration
Elasticsearch v8.8.1 provides the bundled open JDK with its built-in bundle version of open JDK available with its package, it doesn’t require adding JDK explicitly. An alternative solution for those who may require the installed JDK is to set the ES_JAVA_HOME environment variable. Elasticsearch recommends using a supported LTS version of Java.
In Open JDK we need to set the JVM heap size according to the machine/server. For that edit the “elasticsearch-8.8.1\config\jvm.options” file available in the config folder of the “elasticsearch-8.8.1” folder and make the following changes (here we are setting heap size to 4GB):
-Xms4g
-Xmx4g
Note: For more information regarding the elastic heap size please refer to the below link
If Elasticsearch bundles JDK needs to be used in Elasticsearch v8.8.1, when ES_JAVA_HOME is still present in the environment variable for use in an earlier version of Elasticsearch. The following steps need to be followed:-
Open the bin folder in the location at which Elasticsearch v8.8.1 is extracted and find the file named elasticsearch-env.bat.
Edit the elasticsearch-env.bat file and make the following changes.
Enter the Elasticsearch bundle JDK path in variable JAVA in the file, by replacing "%ES_JAVA_HOME%\bin\java.exe" with "%ES_HOME%\jdk\bin\java.exe" in the file.
Steps to install Elasticsearch 8.8.1 version on the local machine :
Windows Installation Steps (via command prompt):
Download the ElasticSearch setup (ZIP file for CMD installation) for the 8.8.1 version.
Unzip the downloaded set-up at the desired location.
Edit the “elasticsearch.yml” file available in the config folder of the “elasticsearch-8.8.1” folder and make the following changes:
cluster.name: elasticsearch
http.port: 9200
node.name: System_Name
path.data: D:\elasticsearch-8.8.1\data
path.logs: D:\elasticsearch-8.8.1\logs
path.repo: D:\elasticsearch-8.8.1\repo
transport.port: 9700
xpack.security.enabled: false
Notes -Configure a valid HTTP port.
The path of the data folder available in the “elasticsearch-8.8.1” folder should be set as the value for path.data.
The path of the logs folder available in the “elasticsearch-8.8.1” folder should be set as the value for path.logs.
All the above-mentioned settings will automatically get added to the elasticsearch.yml file if the installation is done.
Set the machine name as the value for the “node.name”.
The data and logs folder path should not be the same as other installed Elasticsearch versions.
For older versions if any on the same machine, then this port needs to be different for old versions.
If the older elastic version is installed then follow the steps that are documented in the important section.
Open the command prompt in administrative mode.
Follow the below steps to install the Elasticsearch service:
cd {path of the bin folder available in the “elasticsearch-8.8.1” folder}
e.g.: cd D:\ElasticSearch\elasticsearch-8.8.1\bin
Press enter.
Enter the following commands:
After successful installation, the search service can be seen in the window's services list. Change the startup type from "Manual" to "Automatic" in the service properties.
Important
The following points need to be taken care of at the time of installation:
If there are environment variables with the names “ES_HOME” and “ES_PATH_CONF” available in the “System Variables” section then delete them.
If an older version of Elastic is already installed and Elastic service id is the same than the following error will display on your screen
To fix this issue follow the below steps:
Have to rename all existing elastic services ( 7.16.2 , 7.6 etc) to unlock the v8 installation
In the elastic search folder ( C:\dev\elasticsearch-7.16.2\bin) you have to rename the elasticsearch-service.bat service.
To Rename the elasticsearch-service.bat file open the file in a text editor and modify the code like below
For example, the existing elastic version is 7.16.2Save the file and follow the install
Some of the settings that are already available or can be added in the “elasticsearch.yml” file are deprecated and will be removed in future releases of Elasticsearch, more information will be available in the “elasticsearch_deprecation.log” file, located in the “config” folder of Elasticsearch setup
NOTE:-
- The Windows MSI installer package is no longer available from ES 7.17 release. Please refer to the Elastic documentation for more details.
- If already any elasticsearch service is running on the machine with port 9200, then this existing service port needs to be changed.