How to use the Head plug-in in Elasticsearch
This article focuses on "how to use the Head plug-in in Elasticsearch". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor learn how to use the Head plug-in in Elasticsearch.
Basic environment
System Node name IP Software version CentOS7.3 els1 172.18.68.11 Elasticsearch7.0 CentOS7.3 els2 172.18.68.12 Elasticsearch7.0 CentOS7.3 els3 172.18.68.13 Elasticsearch7.0
I. installation
The official website address https://github.com/mobz/elasticsearch-head of the plug-in is hosted in github and downloaded directly from github, so you need to install git first and use npm when installing the plug-in. So npm is installed at the same time (note: npm is in the epel source) yum install git npm # npm in the epel source git clone https://github.com/mobz/elasticsearch-head.git # installation process requires a connection to the Internet cd elasticsearch-head # git clone will automatically generate a directory npm installnpm run start
Second, testing
Open http://172.18.68.11:9200 using a browser. If the head plug-in can be opened normally, it means that the installation of the head plug-in is correct. Now, where does the cluster health state show that it is not connected? this is because the head plug-in does not have the permission to obtain the information of the cluster node. Next, set the permission.
III. Authority setting
If you want to query cluster health information, you need to authorize it in the elasticsearch configuration file.
Vim / etc/elasticsearch/elasticsearch.ymlhttp.cors.enabled: enable CORShttp.cors.allow-origin in true # elasticsearch: "*" # allowed access to the IP address field, * all IP can access
IV. Testing
Fill in the test index
Curl-XPUT '172.18.68.11 purge 9100 Universe booklet'
Open the browser
Open it again through the browser, enter the IP address of the authorized section (the two lines above), and click the link to see the cluster health information and the shard information of the test index.
You can view all the information by clicking on the data browsing, but you can't see it without inserting data here. The next article will record how to input, output, and filter data
At this point, I believe you have a deeper understanding of "how to use the Head plug-in in Elasticsearch". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!