Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Head plug-in in Elasticsearch

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report