The following is the Elasticsearch-head plug-in installation in ElasticSearch-5.3.1 use:
1. Installing the NODEJS Environment
1) wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
2) TAR-ZXVF node-v4.4.7-linux-x64.tar.gz
3) Export path= $PATH:/opt/node-v4.4.7-linux-x64/bin
Test node--version
v4.4.7
2. Install NPM
Download the NMP installation package, the general Nodejs package already contains, set the environment variable can be used directly with the NMP command, if not installed, first download:
Website address: www.npmjs.com
Taobao Address: https://npm.taobao.org/mirrors/npm/
The installation uses the following command:
Node Cli.js install NPM-GF
3. Installing grunt
1) Install Grunt command line tool grunt-cli NPM install-g grunt-cli
2) Install grunt and its plugin npm install grunt--save-dev
You can use Grunt-version to view the installation version
Then, on the 220 server,
git clone git://github.com/mobz/elasticsearch-head.git
CD Elasticsearch-head
NPM Install
NPM Install grunt--save
Modify Elasticsearch-head under the Gruntfile.js file, the default listener in 127.0.0.1 under 9200 port,
Then Cd/usr/local/elasticsearch-head executes grunt server
Browser Access Http://172.16.31.220:9100/
The interface appears:
The problem with the Head master page can be displayed, but the connection fails "cluster health value: Not Connected" 4, Solution Modify the Elasticsearch.yml file
1 2 3 4 |
Vim $ES _home$/config/elasticsearch. YML # Add the following fields Http.cors.enabled:true http.cors.allow-origin: "*" |
Restart ES to
Change Server listener address
Catalog: Head/gruntfile.js
Connect: {
server: {
options: {
port:9100,
hostname: ' * ',
base: '. ',
keepalive:true
}
}
}
Add hostname property, set to * Modify 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";
Ok here, the ElasticSearch-5.3.1 cluster, and the head plug-in installation is over.