Elasticsearch 5.0--head Plug-in Deployment Guide __elasticsearch

Source: Internet
Author: User
Tags install node git clone

The basic use of ES will use head, but the version upgrade to 5.0, the head plugin is not good to make. Let's see how to start the head plugin in 5.0. Official Rough Tutorials

Running with built in server

Enable cors by adding http.cors.enabled:true in Elasticsearch configuration. Don ' t forget to also set http.cors.allow-origin because no origin by default. Http.cors.allow-origin: "*" is valid value, however it's considered as a security risk as your cluster are open to cross or Igin from anywhere.

Check Elasticsearch documentation on this parameter:

git clone git://github.com/mobz/elasticsearch-head.git
CD elasticsearch-head
npm install
grunt Server

Open Http://localhost:9100/
This'll start a local webserver running on port 9100 serving Elasticsearch-head

Best option if you are are likely to connect to several different clusters deploy the 5.0 version of ES

The 5.0 version of the ES with the previous version of the biggest difference is a lot of environmental verification, such as Jdk,max-files and so on. Set Kernel parameters

vi/etc/sysctl.conf
# Add the following content
fs.file-max=65536
vm.max_map_count=262144
Set Resource parameters
vi/etc/security/limits.conf
# Modify
* Soft Nofile 32768
* Hard Nofile 65536
to modify Elasticsearch parameters

Modify the parameters used by es:

# Change the name of a cluster to avoid mixing with other people's clusters
cluster.name:es-5.0-test

# Change the node name
node.name:node-101

# Modify the ES's listening address, So 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
Http.cors.enabled:true
http.cors.allow-origin: "*"
Note that when you set the parameters: there are spaces behind. Install Deployment Head first step, install Git

You need to download the code from the github, so install git first

Yum-y Install git

Once the installation is complete, you can download the code directly:

git clone git://github.com/mobz/elasticsearch-head.git

After downloading, modify the next 777 permissions (simple rough), and then copy to the ES plugins below, for reference:

/es_home/plugins/head/*
Step Two, install node

Because the head plug-in is essentially a NODEJS project, you need to install node and use NPM to install the dependent packages. (NPM can be understood as MAVEN)

Go to the website to download nodejs,https://nodejs.org/en/download/

The downloaded jar package is in XZ format, and General Linux may not be recognized and need to be installed XZ.

Yum-y Install XZ

Then unzip the NODEJS installation package:

xz-d node*.tar.xz
TAR-XVF Node*.tar

After you unpack the node's installation files, you need to configure the environment variables, edit/etc/profile, add

# Set node environment
export node_home=/usr/elk/node-v6.9.1-linux-x64
export path= $PATH: $NODE _home/bin

Don't forget to immediately execute the following

Source/etc/profile

This is the time to test whether node is in effect:

[Root@localnode1 node-v6.9.1-linux-x64]# echo $NODE _home
/usr/elk/node-v6.9.1-linux-x64
[root@localnode1 node-v6.9.1-linux-x64]# node-v
v6.9.1
[root@localnode1 node-v6.9.1-linux-x64]# npm-v
step three, install grunt

Grunt is a very convenient building tool, can be packaged compression, testing, execution, etc., 5.0 of the Head plug-in is launched through the grunt. So you need to install Grunt:

NPM Install GRUNT-CLI

After the installation is complete, check:

[Root@localnode1 elasticsearch-head]# grunt-version
grunt-cli v1.2.0
Grunt
Fourth step, revise head source code

Because the head code is still version 2.6, direct execution has many limitations, such as inability to access across machines. So users need to modify two places: Modify Server Listener address

Table of Contents: Elasticsearch-5.0.0/plugins/head/gruntfile.js

Connect: {
    server: {
        options: {
            port:9100,
            hostname: ' * ',
            base: '. ',
            keepalive:true
        }< c11/>}
}

Add hostname property, set to * Modify connection Address:

Table of Contents: Elasticsearch-5.0.0/plugins/head/_site/app.js

To modify the head's connection address:

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

Modify the localhost to your ES server address, such as:

This.base_uri = This.config.base_uri | | This.prefs.get ("App-base_uri") | | "Http://10.10.10.10:9200";
step Fifth, run head

First Open 5.0 ES.

Then in the head directory, perform the package since the NPM install download:

Finally, start Nodejs

Grunt Server
visit: target:9100

At this time, access to http://xxx:9100 can access the head plugin.

Reference

Head Official Document
From:http://www.itdadao.com/articles/c15a700524p0.html

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.