Install Elasticsearch Windows and Configure for Kibana

Author

Reads 667

A contemporary office setup featuring desks with lamps, a camera, and divided workspace layout.
Credit: pexels.com, A contemporary office setup featuring desks with lamps, a camera, and divided workspace layout.

To install Elasticsearch on Windows, you'll need to download the Elasticsearch installation package from the official Elasticsearch website.

You can download the Elasticsearch installation package from the official Elasticsearch website.

First, ensure you have a 64-bit version of Windows 10 or Windows Server 2019 installed, as Elasticsearch requires a 64-bit operating system.

Elasticsearch is available in three versions: Community, Enterprise, and Enterprise X-Pack.

If this caught your attention, see: Rclone Installation

Installation

To install Elasticsearch on Windows, navigate to the Elasticsearch directory, which is typically located at C:\elasticsearch.

First, you need to download the Elasticsearch installer from the official Elasticsearch website.

The Elasticsearch directory contains all the necessary files for the installation process.

After downloading the installer, run it and follow the prompts to complete the installation.

Download and Extraction

To download and extract Elasticsearch on Windows, you'll need to visit the official Elasticsearch website and download the ZIP package for Windows.

You can do this by visiting the official Elasticsearch website at https://www.elastic.co/downloads/elasticsearch.

Credit: youtube.com, How to Install Elasticsearch in Windows 2024 🚀🚀🚀 | How to Install Kibana on Windows 2024 🚀🚀🚀

There are two ways to run Elasticsearch on Windows—running the batch file from the unzipped archive, or downloading and running the MSI installer.

To extract the contents of the ZIP file, you'll need to use an unzip tool such as 7-Zip.

Here are the steps to extract the contents of the ZIP file:

  • Extract the contents of the zip file to a directory of your choice (e.g., C:\elasticsearch-8.12.0).
  • Once the package has been unzipped, navigate to the folder’s locating in Windows Explorer, or open command prompt and cd into the directory: cd Elasticsearch-6.6.1.
  • You can run the batch file by typing the full filename in command prompt, or by double-clicking the file itself in Windows Explorer.

Note: Administrator privileges may be required to execute the batch file.

Configuration and Setup

To get started with Elasticsearch on Windows, you'll need to configure a few key settings. First, open the kibana.yml file in the config folder and set the username and password of the 'kibana_system' user in the elasticsearch.username and elasticsearch.password fields.

You'll also need to set the Elasticsearch URL in the elasticsearch.hosts field. This is crucial for connecting to your Elasticsearch instance. Keep in mind that you should keep elasticsearch.ssl.verificationMode as none to skip Elasticsearch SSL verification.

Lastly, set an encryption key to secure saved objects. This will add an extra layer of security to your Elasticsearch setup.

Kibana.yml Configuration

Credit: youtube.com, Kibana and Elasticsearch Installation

To configure the kibana.yml file, you'll need to make a few key changes.

First, open the kibana.yml file in the config folder. Set the username and password of the 'kibana_system' user in the elasticsearch.username and elasticsearch.password fields.

You'll also need to set the Elasticsearch URL in the elasticsearch.hosts field. This will point Kibana to the correct Elasticsearch instance.

To skip Elasticsearch SSL verification, keep elasticsearch.ssl.verificationMode as none. This will save you some hassle down the line.

To secure saved objects, you'll need to set an encryption key. This will ensure that your sensitive data is properly encrypted.

Modification with yml

To modify the Elasticsearch configuration, you'll need to edit the elasticsearch.yml file. Open the file in the configuration folder and search for the path.data setting.

This setting determines where Elasticsearch stores its data. You can set it to a single data folder or multiple data folder paths. For example, you can specify a single data folder like this: C:\elasticsearch-8.12.0\data.

To store data in multiple folders, separate the paths with commas. Make sure to keep the quotes around the paths to avoid any issues.

A different take: Elasticsearch Spring Data

Changing the Name

Various tangled wires connected to system near black metal cases in server room
Credit: pexels.com, Various tangled wires connected to system near black metal cases in server room

Changing the name of a Windows Service is a good practice to make it more clear.

You can change the name of the service by right-clicking it and going to Properties. This is a straightforward process that can be done with just a few clicks.

It's a good idea to rename the Elastic Search Windows Service to something more descriptive. To do this, right-click the Elastic Search service and go to Properties.

Running and Starting

To start and run Elasticsearch on your Windows machine, you'll need to follow these steps.

First, you need to install the Elasticsearch service by running the elasticsearch-service.bat install command in the Elastic Search /bin folder.

Next, to make sure the Elasticsearch service runs every time your machine starts, you need to go to the services, select the service, and set the startup type to automatic.

You can start and stop the Elasticsearch service using the .bin\elasticsearch-service.bat start and .bin\elasticsearch-service.bat stop commands, respectively.

Credit: youtube.com, Install and Configure Elasticsearch in Windows

To check if the service is running, you can use cURL to make a GET request to localhost:9200/. If you haven't already, you'll need to download and install cURL on your Windows machine first.

Here are the steps to start and run Elasticsearch:

  1. Start the Elasticsearch service using the .bin\elasticsearch-service.bat start command.
  2. Check if the service is running by making a GET request to localhost:9200/ using cURL.

Prerequisites and Preparation

To install Elasticsearch on Windows, you'll need a few things in place first. Java Runtime Environment (JRE) version 8 or higher is a must-have, so make sure you have that installed on your system.

You'll also need to ensure you have sufficient memory and disk space available for Elasticsearch to run efficiently. This is crucial for a smooth installation process.

Here are the specific Java requirements: Java 1.8 and JDK 8 are the minimum versions needed, although JDK 9 is only supported by Elasticsearch 7.

If you're using a 32-bit Windows PC, be aware that the Elastic Stack does not have 32-bit support, which may cause issues during installation and running of the Elastic products.

Broaden your view: Elastic Search by Field

Prerequisites

A clean, minimalist setup featuring a silver computer on a sleek white desk.
Credit: pexels.com, A clean, minimalist setup featuring a silver computer on a sleek white desk.

To get started with Elasticsearch, you'll need to ensure your system meets the minimum requirements. Java Runtime Environment (JRE) version 8 or higher is a must-have.

You'll also need sufficient memory and disk space available for Elasticsearch to run efficiently. This will ensure a smooth installation and operation process.

The Windows PC or server needs to have Java installed, specifically running Java 1.8 and JDK 8. If you're using Elasticsearch 7, you may also have support for JDK 9.

To verify the Java version on your system, open a command prompt window and type "java -version". This will return the default version of Java. For more information, you can check Oracle's documentation.

To select a specific version of Java for your machine to use, configure the JAVA_HOME environment variable. This involves editing the Environment Variables to point to the correct software location.

Here are the specific steps to configure the JAVA_HOME environment variable:

  • Right-click My Computer and choose Properties.
  • Click on Advanced and select Environment Variables to edit JAVA_HOME.
  • Edit JAVA_HOME to point to the correct software location, for example: C:Program FilesJavajdk1.X.X (replace X with the proper version number of JDK).

Remember, the Elastic Stack does not have 32-bit support, so you may encounter issues installing and running the Elastic products on a 32-bit Windows PC.

See what others are reading: Elastic Search Cluster

Open Ports Inside Machine

Business professional at the desk examining a software development agreement document.
Credit: pexels.com, Business professional at the desk examining a software development agreement document.

To open ports inside the machine, you'll need to access the Windows Defender Firewall settings. Go to Windows Defender Firewall > Advanced settings.

Select "Port" and follow the prompts to choose "TCP" and type "9200" in "Specific local ports". If the port is blocked by the firewall, this step will help you open it.

If you're using a VM hosted on Azure, ensure the port is enabled inside the VM's Networking setting. You can refer to the article about preparing the VM on Azure for more information.

To confirm the port is open, start Kibana and log in. Then, navigate to roles and click on the role you created.

Default Data Folder:

To get started with Elasticsearch, you'll want to know where your data will be stored by default.

Elasticsearch data is stored in a specific folder, which is the 'data' folder within the Elasticsearch directory.

This is where all your data will be kept unless you specify a different location.

Checking and Verification

Credit: youtube.com, How to install Elasticsearch in Windows 2024 | Step by step Guide

To ensure Elasticsearch is installed correctly, you'll want to verify its status. This can be done by checking its status output in a console window.

You can use cURL to make a GET request to check if the service is running on your local server. The command to do this is: curl -X GET "localhost:9200/".

To make this command work, you'll need to have cURL installed on your Windows machine. If you haven't already, download and install cURL before proceeding.

After verifying the installation, you should see cluster and log information in the console window. This indicates that Elasticsearch is running properly.

Take a look at this: Install Window Blinds

Kibana and Elasticsearch

Installing Elasticsearch on Windows can be a bit of a process, but don't worry, I've got you covered. You'll need to access your Windows VM and make sure it's updated with the latest patches.

To start, you'll need to download two components from the latest release: Elasticsearch and Kibana. These will be in the form of .zip files, which you should move to a folder of your choice and extract.

Credit: youtube.com, How To Install Elasticsearch and Kibana on Windows

Once you've extracted the files, open a command prompt (CMD) and run the elasticsearch.bat file. This will configure the self-signed SSL certificate and allow you to use the HTTPS protocol.

As you run the installation, you'll see a command prompt window with some important information. This includes the password to the superuser and the enrollment token that you'll need later when connecting to Kibana. Be sure to copy these details and save them for future use.

Now, you might be wondering how to connect Elasticsearch with Kibana. Don't worry, it's straightforward. Open a new command prompt window and navigate to the /bin folder of Kibana. Then, run the kibana.bat file.

Once you've done this, you can open Kibana in your browser by entering the URL and logging in with the username "elastic" and the password of the Elastic built-in superuser.

Automation and Scripting

Automation and Scripting can greatly simplify the process of installing and setting up Elasticsearch on Windows.

Credit: youtube.com, How to install Elasticsearch on Windows

The automation script for Elasticsearch and Kibana can be found in the second part of a comprehensive guide on Medium.

This script automates the startup process of both services, ensuring a streamlined and efficient way to launch them.

It navigates to the respective bin directories, starts Elasticsearch and Kibana, introduces delays to allow for proper initialization, and opens Google Chrome with the specified link to access Kibana.

Text-to-speech functionality is not mentioned in this script.

For another approach, see: Elasticsearch Script

Uninstallation

To uninstall Elasticsearch on Windows, you'll want to run the uninstallation command.

The command to uninstall the service is .bin\elasticsearch-service.bat remove.

X Pack Installation

X-Pack Installation is a crucial step in setting up your Elasticsearch cluster. If you're using version 6.2 or newer, you're in luck - X-Pack will be installed and set up automatically as you install the Elastic products.

You'll want to make sure you're running the latest version of Elasticsearch to take advantage of this feature.

For your interest: Elasticsearch X Pack

Credit: youtube.com, Install X-Pack on Elasticsearch and Kibana

If you're using an older version of the Elastic Stack, version 5 or older, you'll need to consult Elastic's documentation for guidance on installing X-Pack.

It's worth noting that the installation process for X-Pack has changed over time, so be sure to check the documentation for the specific version you're using.

Emanuel Anderson

Senior Copy Editor

Emanuel Anderson is a meticulous and detail-oriented Copy Editor with a passion for refining the written word. With a keen eye for grammar, syntax, and style, Emanuel ensures that every article that passes through their hands meets the highest standards of quality and clarity. As a seasoned editor, Emanuel has had the privilege of working on a diverse range of topics, including the latest developments in Space Exploration News.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.