ElasticSearch配置Head

Install and configure node.js

  1. Go to the official website to download the latest version of node: http://nodejs.cn/download/
    Baidu Cloud:
    Link: https://pan.baidu.com/s/1usLKcn1FpSjKoaTh23eWZg
    Extraction code: 19tn to
    Insert picture description here
    get node-v12.13.0-linux-x64. tar.xz file, upload to linux
  2. Use command to convert xz file to tar file
xz -d node-v12.13.0-linux-x64.tar.xz
  1. Unzip the tar file:
tar -xvf node-v12.13.0-linux-x64.tar
  1. Configure environment variables
    Copy the installation path, mine is as follows: /opt/local_software/node-v14.6.0-linux-x64
vi /etc/profile

Add the following code:

export NODE_HOME=/opt/local_software/node-v14.6.0-linux-x64
export PATH=$PATH:$NODE_HOME/bin 
  1. Update environment variables
source /etc/profile
  1. Verify that the installation is successful:
node -v

Install npm

If not installed, please refer to the blog linux installation npm
verification version:
Insert picture description here

Install es-head

Download path: My Baidu Cloud
Link: https://pan.baidu.com/s/18pjsia7dTe_U4nP3gfC8dA
Extraction code: io4z

  1. Upload to linux
  2. unzip files
unzip elasticsearch-head-master.zip
  1. Enter the folder, modify the configuration file
  2. Modify the Gruntfile.js file
vi Gruntfile.js

Add a line of hostname (you can enter /connect and press Enter to directly locate this line)

connect: {
    
    
       server: {
    
    
               options: {
    
    
                       port: 9100,
                       base: '.',
                       hostname: '*',
                       keepalive: true
               }
       }
}
  1. Modify the app.js file
vi _site/app.js

Modify this line: the following ip should be the ip and port of es (you can enter /this.bash and press Enter to directly locate this line)

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.135.237:9201";
  1. Execute npm command 1 (otherwise the seventh step is likely to report an error)
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
  1. Execute npm command 2
npm install
  1. Modify the elasticsearch.yml file of ES
 vi config/elasticsearch.yml 

Add the following lines, because ES does not support cross-domain by default, so we should configure cross-domain configuration to allow ES to connect to the head plugin

http.cors.enabled: true
http.cors.allow-origin: "*"

Run ES-head

Run ES
Run ES-head

Start head in the foreground:

./node_modules/grunt/bin/grunt server 

When the following interface appears,
Insert picture description here
you can access the page:
http://192.168.135.237:9100/
Insert picture description here
modify the ip address in the text box and click connect (mine is a cluster of 5 ESs, and the following page happens to be 5 nodes):
Insert picture description here

Start head in the background:

nohup ./node_modules/grunt/bin/grunt server > es-head-start.log 2>&1 & 

Guess you like

Origin blog.csdn.net/Zong_0915/article/details/107638327