In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how Elasticsearch installs the graphical interface tool Head plug-in, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
1. Introduction and download of Head plug-in
Head plug-in is a graphical interface tool of Elasticsearch. Through this plug-in, it is very convenient to add, delete, modify, query and other data interactive operations. After the Elasticsearch6.x version, the head plug-in is already a separate Web App, so there is no need to integrate with Elasticsearch. The Head plug-in can be installed on any machine, and here the Head plug-in is installed on the 172.16.0.57 (server1) machine, which readers can download from https://github.com/mobz/elasticsearch-head.
Since the Head plug-in is essentially a Node.js project, you need to install Node.js and use the npm tool to install the dependent packages. Here we briefly talk about Node.js and NPM as the groundwork for knowledge.
Node.js is a Javascript running environment and a new front-end framework, which is used to build network applications with fast response and easy to expand conveniently.
NPM, whose full name is Node Package Manager, is a Node.js package management and distribution tool that defines package dependency standards and provides downloads of common third-party frameworks needed for JavaScript development.
2. On Centos7 series systems, Node.js and NPM tools can be installed online directly through yum.
[root\ @ localhost\ ~]\ # yum install-y nodejs npm
Download the Head plug-in. Here we download the Head plug-in through git, so we need to install the git tool first
[root\ @ localhost\ ~]\ # yum install-y git
Next, start installing the head plug-in, where you install the head plug-in to the / usr/local directory, as follows:
[root\ @ localhost local]\ # git clone git://github.com/mobz/elasticsearch-head.git
The first step is to clone the head plug-in from github through the git command
The cloned head plug-in is named elasticsearch-head. Go to this directory to modify the configuration file: / usr/local/elasticsearch-head/_site/app.js, and modify the contents shown below:
It means that the head plug-in will access the elasticsearch cluster through 172.16.0.51.
Note: you can get all the information about the cluster by visiting any node in the elasticsearch cluster.
Start the configuration and then install
[root\ @ localhost local]\ # npm config set registry= http://registry.npm.taobao.org/[root\@localhost local]\ # cd elasticsearch-head [root\ @ localhost elasticsearch-head]\ # npm install
The first step is to change the source address to Taobao NPM image, because the official source of default NPM is https://registry.npmjs.org/. The download speed abroad will be very slow, so it is recommended to switch to Taobao's NPM mirror site. The fourth step is to install the libraries and third-party frameworks required for the head plug-in.
Note: if you report an error, please check out: npm install Times phantomjs-prebuilt@2.1.16 installation failed, solution: npm install phantomjs-prebuilt@2.1.16-- ignore-scripts, and then execute npm install again
3. Modify elasticsearch configuration.
In the above configuration, the address of the head plug-in to access the cluster is configured as 172.16.0.51 (this is a host in my es cluster). Next, you need to modify the configuration of elasticsearch on this host to add cross-domain access support.
Modify the leasticsearch configuration file of this host to allow the head plug-in to access elasticsearch across domains, and add the following at the end of the elasticsearch.yml file:
Http.cors.enabled indicates that slug access support is enabled. This value defaults to false. Http.cors.allow-origin indicates the addresses of domain names allowed for cross-domain access. Regular expressions can be used, where "*" means that all domain names are allowed to access.
4. Start head plug-in service.
Then we can start the service with the head plug-in installed.
[root\ @ localhost\ ~]\ # cd / usr/local/elasticsearch-head [root\ @ localhost elasticsearch-head]\ # npm run start
After the head plug-in service is started, the default access port is 9100. You can open http://172.16.0.57:9100 directly in the browser, as shown below:
First of all, you can see that the elasticsearch cluster has three nodes: elk01, elk02 and elk03, of which elk01 is the current master node. Click the information button on the figure to view node details.
Second, from this page you can see the basic information about elasticsearch shards, such as main shards, replica shards, and so on, as well as how many shards are available. Since 5 shards and one copy shard are set in the elasticsearch configuration, you can see that each index has 10 shards, and each shard is represented by 0, 1, 2, 3, 4 and other digital plus boxes, where the bold box is the main shard and the fine box is the replica shard.
In the figure, ELK-chaofeng is the name of the cluster, and the "cluster health value" indicates the health status of the cluster through different colors: green indicates that both the main shard and the replica shard are available; the yellow color indicates that only the main shard is available, but no replica shard is available; red indicates that some indexes in the primary shard are not available, but some indexes can continue to be accessed. Under normal circumstances, it shows green.
After reading the above, do you have any further understanding of how Elasticsearch installs the graphical interface tool Head plug-in? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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: 241
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.