ELK detailed explanation (4) - Head plug-in installation

Today, I will continue to introduce you to the relevant knowledge of Linux operation and maintenance. The main content of this article is the installation of the Head plug-in of Elasticsearch.

1. Introduction to the Head plugin

In ELK Detailed Explanation (2) - Elasticsearch Installation and Deployment , we implemented the installation and deployment of Elasticsearch in the ELK architecture, and finally can access Elasticsearch, and get the following results:
insert image description here
During the use of Elasticsearch, we cannot always The log information stored by Elasticsearch is displayed through commands. Therefore, we need to install a plug-in to help us check the status of Elasticsearch. The Head plugin can help us achieve this function, and it is open source and free, so today we will configure and implement the following Head plugin.

2. Head plug-in installation

There are two ways to install the Head plug-in, one is to find the installation package of the Head plug-in directly on the Internet; the other is to go to Git to download, the Git URL is https://github.com/mobz/elasticsearch-head , we can After installing the Git client, execute the command:

git clone https://github.com/mobz/elasticsearch-head.git

Then use NPM to install, execute the command:

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

If you use the installation package of the Head plug-in, you can download it directly.

3. Modify the Elasticsearch configuration

After that, in order to allow Elasticsearch to allow the installation of the Head plugin, we need to configure Elasticsearch, open the Elasticsearch configuration file /etc/elasticsearch/elasticsearch.yml, and add the following content at the bottom of the configuration file:

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

After the configuration is complete, restart Elasticsearch.

Fourth, the effect display

After the Head installation is complete, execute the command:

npm run start &

You can open the Head plugin and make it run in the background. The execution process is as follows:
insert image description here

Note:
If there is no npm command, you can install an EPEL extension source first, and then execute the command:
yum install -y npm
to complete the installation.

Note that after the above command is executed, Ctrl+C can be used to exit manually. After the Head plugin runs, it will listen to the local port 9100, as shown below: In
insert image description here
this way, we can access the 9100 port of the following Head plugin, and the result is as follows:
insert image description here
We enter any node in the two clusters in the search box (in fact, The Head plug-in can also be installed on any node in the cluster), click "Link", you can successfully link the two clusters, the result is as follows:
insert image description here
So far, our Head plug-in installation and deployment is successful!
Originality is not easy, please indicate the source for reprinting: https://blog.csdn.net/weixin_40228200

Guess you like

Origin blog.csdn.net/weixin_40228200/article/details/123945119