How to install elasticsearch-5.2.1 under Windows

Source: Internet
Author: User
Tags install node

elasticsearch-5.2.1 Installation Method

1. Installing Java
    1. Download install Java JDK above 1.8
    2. Configuring Java Environment variables

Right-click My Computer---Properties-----advanced system Settings---environment variables,


Select "New System Variable"--pops up the "New System Variable" dialog box, enter "Java_home" in the "Variable name" text box, enter the installation path of the JDK in the "Variable Value" text box (that is, the folder path of step 5), click the "OK" button,

View the path variable in the system variables options area, if it does not exist, create a new variable path, otherwise select the variable, click the Edit button, and append [%java_home%\bin;%java_home%\jre\bin;] to the last position of the variable value text box. or direct "%java_home%\bin;", click the OK button.

View the CLASSPATH variable in the system variables options area, if it does not exist, create a new variable classpath, otherwise select the variable, click the Edit button, and append [.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;].

Then in CMD, use the Javac command to test if it appears, add success:

2. Download Run ES

First, we download the Elasticsearch Toolkit from address http://www.elasticsearch.org/download. Unzip to the specified directory.

1. Windows version 7 desktop environment, run the command line, enter the Cde:\elasticsearch-1.3.4\bin directory.

2. Run Elasticsearch.bat at this time

3. A Elasticsearch node is started on this machine. You will see the following record prompt

    1. Now test it in the browser.

If you get a status of 200 then it means that everything is OK ... Isn't it simple?

Let's look at the meaning of each field represented by JSON:

Ok: When True, it means that the request was successful.

Status: The error code for HTTP after the request is made. 200 means everything is fine.

Name: We elasticsearch the name of the instance. By default, it will randomly select one from a giant long list of names.

Version: This object has a number field that represents the currently running version of Elasticsearch, and a snapshot_build field that represents whether the version you are currently running is built from source code.

Tagline: Contains the first Tagline of Elasticsearch: "Youknow, for Search."

3. Installing the Es-head plugin 3.1 download node. js
    1. Download node. js , URL: https://nodejs.org/en/
    2. Install node to D drive. such as D:\nodejs.
    3. Set the Node_home to the environment variable (the installation package can also automatically add the PATH environment variable). Test If node is in effect:

* After installing the Nodejs to re-open a CMD, otherwise no matter how to configure the variable is useless

3.2 Installing Grunt
    1. Grunt is a handy build tool for packaging compression, testing, execution, and so on, and the 5.0-in head plugin is launched through grunt. So you need to install Grunt:
    2. Note: The path is cut to D:\nodejs.
    3. NPM install-g GRUNT-CLI
    4. -G represents a global installation. The installation path is C:\USERS\YOURNAME\APPDATA\ROAMING\NPM and the path variable is automatically added. After the installation is complete, check:

3.3 Download Head Plugin

Https://github.com/mobz/elasticsearch-head

3.4 Modifying the head file

Because the head code is also version 2.6, there are many restrictions on direct execution, such as the inability to access across machines. So users need to modify two places:

Catalog: head/gruntfile.js:

Connect: {
Server: {
Options: {
PORT:9100,
Hostname: ' * ',
Base: '. ',
Keepalive:true
}
}
}

Add the Hostname property, set to *,

To modify the connection address:

Catalog: Head/_site/app.js

To modify the connection address of the head:

This.base_uri = This.config.base_uri | | This.prefs.get ("App-base_uri") | | "Http://localhost:9200";

Change localhost to the server address of your ES, such as:

This.base_uri = This.config.base_uri | | This.prefs.get ("App-base_uri") | | "Http://10.10.10.10:9200";
3.5 Start Head

Modifying the parameters of a Elasticsearch

Modify the parameters used by ES. Edit CONFIG/ELASTICSEARCH.YML:

# Change the name of the cluster to avoid mixing with others ' clusters
Cluster.name:es-5.0-test
# Change the name of the node
Node.name:node-101
# Modify the listener address of ES so that other machines can also access
network.host:0.0.0.0
# The default is good
http.port:9200
# Add new parameters so that the head plugin can access ES

* Note that when setting parameters: there are spaces behind!

Open ES-5.0.0:

D:\ElasticSearch-5.0.0\bin\elasticsearch.bat

Start effect:

Then in the head source directory, execute the NPM install download package:

NPM Install

Effect

A warning or error may be reported for the initial run of the installation. You can rerun the NPM install once.

Finally, start Nodejs under the head source code directory:

Grunt Server

Effect

Visit: target:9100

At this point, access http://localhost:9100 can access the head plugin:

4. View the ES running plugins

Http://localhost:9200/_nodes/plugins?pretty=true

How to install elasticsearch-5.2.1 under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.