The use of the Head plugin in Elasticsearch

Introduction: In the process of learning Elasticsearch, it is essential to use some tools to view the running status and data of es. If all requests are made through rest, it will be too troublesome and not humane enough. At this point, head can perfectly help you learn and use Elasticsearch quickly.

In the process of learning Elasticsearch, it is essential to use some tools to view the running status and data of es. If all requests are made through rest, it will be too troublesome and not humane enough. At this point, head can perfectly help you learn and use Elasticsearch quickly.

【Head plugin in Elasticsearch】basic environment


Please refer to the previous article for Elasticsearch cluster construction
http://www.cnblogs.com/aubin/p/8012840.html
systemnode nameIPSoftware version
CentOS7.3els1172.18.68.11Elasticsearch6.0
CentOS7.3els2172.18.68.12Elasticsearch6.0
CentOS7.3els3172.18.68.13Elasticsearch6.0

【Head plugin in Elasticsearch】1. Installation


•Plugin official website address https://github.com/mobz/elasticsearch-head
•Since the plugin is hosted in github , you need to install git first if you want to download it directly from github
•npm is used again , so npm is installed at the same time (note: npm is in the epel source)
yum install git npm # npm in epel source
git clone https://github.com/mobz/elasticsearch-head.git # The installation process requires an internet connection
cd elasticsearch - head # A directory that will be automatically generated after git clone
npm install
npm run start

【Head plugin in Elasticsearch】2. Test


Open http://172.18.68.11:9200 with your browser. If it can be opened normally, it means that the head plug-in is installed correctly
. Now the cluster health status shows that it is not connected. This is because the head plug-in does not have permission to obtain the information of cluster nodes. Next, set the permissions .

【Head plugin in Elasticsearch】3. Permission setting


If you want to query cluster health information, you need to authorize in the elasticsearch configuration file
vim/ etc / elasticsearch / elasticsearch.yml
http.cors.enabled : true _ # Enable CORS in elasticsearch
http .cors.allow -origin: "*" # The IP address segment that is allowed to access, * means that all IPs can access
【Head plugin in Elasticsearch】4. Test
•Fill in the test index
curl -XPUT ' 172.18.68.11:9100/book '
•Open the browser and open it
again through the browser, fill in the IP address of the authorized section (configured in the above two lines), click the link, and you can see the cluster health information and the fragmentation information of the test index.

•You can view all the information by clicking on the data browser, but you can't see it without inserting data here. The next article will document how to input, output, and filter data


Copyright statement: The content of this article is contributed by Alibaba Cloud's real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00