Install Elasticsearch 8.8.2 in Windows environment

Elasticsearch is an open source distributed search and analysis engine, which is widely used to build real-time search, log analysis, data visualization and other applications. This article will detail how to install and configure Elasticsearch 8 in a Windows environment.

Install Elasticsearch

Step 1: Preparations

Before starting the installation, make sure the following requirements are met:

  1. Make sure your computer has at least 4GB of RAM.
  2. Make sure your computer has Java Development Kit (JDK) 8 or later installed.
  3. Make sure you have administrator privileges.

Step 2: Download Elasticsearch

  1. Open a browser and visit the official website of Elasticsearch (https://www.elastic.co/downloads/elasticsearch).
  2. On the download page, find the installation package for Windows and click the download link.
    insert image description here

Step 3: Install Elasticsearch

Unzip the downloaded installation package to a specified location.

Step 4: Configure Elasticsearch

  1. Modify jvm.options under the config directory, add the following content to solve the console garbled problem

    -Dfile.encoding=GBK
    
  2. Navigate to the extracted directory of Elasticsearch, open configthe directory, and edit elasticsearch.ymlthe file.
    Modify xpack.security.http.ssl.enable and xpack.security.transport.ssl.enable to false to
    insert image description here
    add additional

    node.name: node-1  
    cluster.initial_master_nodes: ["node-1"]
    

    node.name is the name used to identify an Elasticsearch node. Each node needs a unique name in the cluster to distinguish different nodes.

    cluster.initial_master_nodes is the setting used to identify the initial master nodes. In an Elasticsearch cluster, the initial master node is the first master node in the cluster. When starting a brand new Elasticsearch cluster, you need to designate a node as the initial master node. Additional nodes will join and establish communication with the initial master node to form a complete cluster.

  3. Save and close the file.

Step 5: Start Elasticsearch

  1. Open Command Prompt (CMD) or PowerShell.
  2. Navigate to the directory where Elasticsearch is installed.
  3. Click bin/elasticsearch.bat to start, and an account with elastic account and random string password will be automatically generated:
    insert image description here
  4. This indicates that Elasticsearch has started successfully.

Step 6: Verify Installation

Open http://localhost:9200 in the browser, and enter the user and password created automatically before:
insert image description here
The following page appears, indicating that the installation is successful:
insert image description here
Seeing this page means that you have successfully installed and configured Elasticsearch 8 in the Windows environment. Now you can start using Elasticsearch to build applications such as real-time search, log analysis, and data visualization.

Install Kibana

Kibana is the front-end display of es data. When analyzing data, you can easily see the data. As a developer, you can easily access es.

Step 1: Preparation

Enter the previous elasticsearch installation directory, enter cmd, open the command line interface, create a user to save the password, the command is as follows: bin\elasticsearch-reset-password -u kibana_systeminsert image description here

Step 2: Download

Enter the official website: https://www.elastic.co/cn/downloads/kibana to download and unzip kibana

Step 3: Modify the configuration file

Open kibana.yml in the config folder of kibana-8.8.2, add configuration information, and add it directly to the end of the kibana.yml file

server.port: 5601  
server.host: "0.0.0.0"
# 国际化中文
i18n.locale: "zh-CN"
# 配置es集群url
elasticsearch.hosts: ["https://localhost:9200"] 
# 创建连接用户的账号和密码
elasticsearch.username: "kibana_system"
elasticsearch.password: "2I=xPXAF9Fng7U-F5QWU"

When finished editing, click Save

Step 4: Start

Double-click kibana.bat in the bin directory to run. The
operation is successful. The browser opens localhost:5601, and the following interface appears to indicate that the operation is successful.

The password is the account password of elasticsearch:

Account: elastic Password: the password saved when starting elasticsearch. Note: This account is not the account password for connecting to the es account:

Step 5: Test Access

Browser access http://localhost:5601
insert image description here

Summarize

Hope this blog
is helpful to you! If you have any questions or need further assistance, please feel free to ask.

Guess you like

Origin blog.csdn.net/qq_39997939/article/details/131610785