elasticsearch-5.2.1 Installation Method
1. Installing Java
- Download install Java JDK above 1.8
- 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
- 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
- Download node. js , URL: https://nodejs.org/en/
- Install node to D drive. such as D:\nodejs.
- 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
- 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:
- Note: The path is cut to D:\nodejs.
- NPM install-g GRUNT-CLI
- -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