ElasticSearch-Install the Head visualization plugin

Install the Head visualization plugin

First, you need to rely on the node.js and npm environment

1 Install node.js

Official download address: http://nodejs.cn/download/ Download the LTS version (long-term stable version)

Installation can change the installation path, the rest is to choose the next step fool is to install

After successful installation is as follows

command test

node -v View the version of node

Npm -v View the version of npm (the new version of node installation comes with npm installed)

2 Configure environment variables

Configure the globally installed module path and cache path (not necessarily the installation path)

In the nodejs folder, create node_global

In the nodejs folder, create node_cache

Open cmd to execute the command to configure the path

npm config set prefix “D:\Tools\Node\node_cache”

npm config set cache “D:\Tools\Node\node_global”

Added system environment variables

NODE_PATH

D:\Tools\Node\node_global

Edit the user variable Path and click Add to store the node_global path

D:\Tools\Node\node_global

Install the most commonly used express modules globally for testing Execute commands

To execute the command, you need to right-click and choose to run as an administrator!

npm install express -g # -g means global installation

3 Globally configure Taobao image (cpnm)

Excuting an order

npm install -g cnpm --registry=https://registry.npm.taobao.org

An error occurred

fix bug

1 Delete the .npmrc file under C:\Users\user\

2 Enter npm cache clean --force on the command line

After successful execution, npm WARN using --force I sure hope you know what you are doing will appear

Then re-enter the Taobao image

Finally execute cnpm -v to get the information

4Download the Headn client

Head download address: https://github.com/mobz/elasticsearch-head/

Download to local and decompress

Install the instructions on github step by step

Open cmd in the project Tip: Enter cmd in the project directory and press Enter to open the local cmd

5 Execute the command to download dependencies

cnpm install

There will be some outdated errors below, don't worry

Check the modules directory, all dependencies have been downloaded

6 Startup Items

npm run start

7 Discover cross-domain

Visit http://localhost:9100 and find that the access is not available, it is cross-domain

Cross-ip, port, and website are all cross-domain performances

8 Solve cross-domain

To solve cross-domain problems, open the yml configuration file

#配置跨域 开启跨域

http.cors.enabled: true

#全部人都可以访问

http.cors.allow-origin: "*"

9 Re-service, client connection service

Then restart the es service

It is found that the bat black window flickers and then closes

Modify the config/elasticsearch.yml file and add the following content:

xpack.ml.enabled: false

Start successfully

Visit http://localhost:9200/

client connected to server

10 Understand the basic properties of the head client

Index location, all information exists here

add an index

create success message

created index

At the beginning stage, understand es as a database, and you can build indexes (databases), documents (data in the library)

view overview

view data browse

Query JSON, you can write it here, but it is not recommended, all the queries we will do later will be done in KIbana

Guess you like

Origin blog.csdn.net/weixin_46713508/article/details/131366677