To visualize ElasticSearch, you need to install plugins that are dependent on the environment, such as Maven.

1. Download the HEAR plug-in and Node, and configure the Node environment

wget  https://github.com/mobz/elasticsearch-head/archive/master.zipCopy the code

Because running head need to run the node so also want to download the node, here is a list node to download https://npm.taobao.org/mirrors/node

Wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz tar ZXVF - node - v4.4.7 - Linux - x64. Tar. Gz# vim /etc/profile // edit the file to add the following contents
//----
NODE_HOME=/usr/local/ SRC/node - v0.10.28 - Linux - x64 CLASS_PATH =. :$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$NODE_HOME/bin
NODE_PATH=$NODE_HOME/lib/node_modules
//----
# source /etc/profiler// Run this command to take effect againCopy the code

Bonus: here is my /etc/profile configuration information

export JAVA_HOME=/usr/local/jdk 
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin        

MAVEN_HOME=/usr/local/ maven3.3.9export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
    
NODE_HOME=/usr/local/ SRC/node - v0.10.28 - Linux - x64 CLASS_PATH =. :$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$NODE_HOME/bin
NODE_PATH=$NODE_HOME/lib/node_modulesCopy the code

Echo $NODE_HOME // Run the following command to view node information

If no information is entered, then you should remember to run the source /etc/profile command with the current login account

Install grunt

Go to /usr/local/src and make sure you have the master.zip file downloaded from the previous step.

Unzip the downloaded elasticSearch-head-master file and run the following command

# npm install -g grunt-cli Copy the code

# grunt -version // Check the versionGrunt - cli v1.3.2Copy the code

3. Modify the head plug-in configuration file

[root@node122 elasticsearch-head-master]# pwd
/usr/local/src/elasticsearch-head-masterCopy the code

Change the server listening address to gruntfile. js, find line 90, connect

connect: {
     server: {
         options: {
            port: 9100,
            base: '. ',
            keepalive: true,
            hostname: The '*'}}}Copy the code

② Modify modify the connection address: _site/app.js, line 4355

 this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") | |"http://172.16.170.122:9200"; // Enter the IP address of your serviceif( this.base_uri.charAt( this.base_uri.length - 1 ) ! = ="/" ) {
                                 // XHR request fails if the URL is not ending with a "/"
                               this.base_uri += "/";
                         }Copy the code

In elasticSearch-head-master directory

# npm installCopy the code

# grunt serverCopy the code

OK ~ that service start, can the browser to http://172.16.170.122:9100/

Four, access,

Additional: Check the memory space occupied by all es data

# curl '172.16.170.122:9200 / _cat indices? v'Copy the code

My service is cluster, here in order to further play ES, in their own development machine to build a service ~