Install and configure ElasticSearch under Windows

The ElasticSearch version we installed below is 6.8.9

1. Download
    download address: https://www.elastic.co/cn/downloads/elasticsearch
    
    historical version download address: https://www.elastic.co/cn/downloads/past-releases

    
    download file includes compressed package and installation Package, it is recommended to download the compressed package (version 6.8.9-20200514)
    version 6.1.0:
        https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.0.zip
    version 6.8.5:
        https://artifacts .elastic.co/downloads/elasticsearch/elasticsearch-6.8.5.zip
    version 6.8.9 (recommended download):
        https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.9.zip
        
    version 7.0.0 :
    Compressed package: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-windows-x86_64.zip
    Installation package:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0.msi
    
2. Installation
    Before installing ElasticSearch, you need to install Java JDK environment
    
    2.1 on your computer. For
        installation and configuration of Java JDK, please refer to: https://blog.csdn.net/qubernet/article/details/107347334
    
    2.2. Unzip the compressed package elasticsearch-6.8.9.zip to the specified installation directory (for example: D:\Net_Program\Net_ElasticSearch)

    
3. Installation service
    3.1, Open a DOS command window (preferably run as an administrator), switch to the bin directory of the ElasticSearch installation directory (ie: D:\Net_Program\Net_ElasticSearch\bin);
    3.2, enter elasticsearch-service.bat install and execute;
    3.3, If no error is reported, the service installation is successful. After the installation is successful, you can see one more service similar to Elasticsearch 6.8.9 (elasticsearch-service-x64) in the service list.


        
4. Test ElasticSearch
    After the service is started successfully, you can enter http://localhost:9200/ in the browser to access, as shown in the figure below, it means that the ElasticSearch service has started successfully:

    
5. Public network access
    If you need public network access, you need to modify the configuration file config /elasticsearch.yml
    version 6.8.9 adds the following three lines of code at the end of the configuration file, restart the service, so that you can use the IP to access http://192.168.3.200:9200/

network.host: 192.168.3.200
http.cors.enabled: true
http.cors.allow-origin: "*"


        
6. Set the password
    6.1. Open the configuration file config/elasticsearch.yml, turn on the x-pack verification, add the following three lines of code at the end of the file, and restart the ElasticSearch service:

xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true


        
    6.2. Open CMD, locate the D:\Net_Program\Net_ElasticSearch\bin directory, execute the following commands to set the passwords of elastic, apm_system, kibana, logstash_system, beats_system, and remote_monitoring_user

elasticsearch-setup-passwords interactive

        After entering the above command, enter y and then enter the password of the corresponding user (here I entered all 123456. Note: Since CMD is entering the password, the password characters will not be displayed, so don’t be surprised Did you not enter it yourself?)
        ElasticSearch 6.8.9 version has set up elastic, apm_system, kibana, logstash_system, beats_system, remote_monitoring_user in sequence.

        After the password is set successfully, we visit http://192.168.3.200:9200/ to find Let us enter the account and password, here we enter elastic 123456 to log in successfully, as shown below:


    6.3. ElasticSearch-Head access configuration
        If you use ElasticSearch-Head to access ES data, you also need to add the following configuration to the config/elasticsearch.yml file, otherwise you will not be able to access:
 

http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

Guess you like

Origin blog.csdn.net/qubernet/article/details/107395400