ELK 实验(七)Elasticsearch 集群管理

Head 插件

head插件是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序。

Github:

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

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

安装

./elasticsearch plugin -install /usr/elasticsearch-head

c3186a2632d2416a8de7be98af79c73b_thumb

新版本不支持plugin 直接安装

安装nodejs

yum install nodejs -y

居然还没有nodejs

去官网下一个

https://nodejs.org/en/download/package-manager/

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

e094e8e57dda4fabba81323aa71c66e1_thumb

再来

yum install -y nodejs

yum install -y gcc-c++ make

就有了,17M

b14b42c5e6a348afa00910153298aab0_thumb

09c2dc6e2de44a85b338f3d3275cadf7_thumb

验证下安装

node -v

npm -v

7dde2e56967c4a57851b7181a0063160_thumb

使用国内淘宝源安装grunt

cd elasticsearch-head/

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

c54ab62a62ff44d5aa3fda03789a122f_thumb

6198b7f991dd43c9a046f3b927627269_thumb

npm install grunt --save

看看安装好了么

ls -d node_modules/grunt

f9328281ec7d4abf89857eb413c3e140_thumb

npm install -g grunt-cli --registry=https://registry.npm.taobao.org

ad39f8b55af44573a0495df01f48e953_thumb

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

f400942dd0ef4de5a9082a4992d61895_thumb

出错鸟,连接被拒绝了,容我修个错误

PhantomJS not found on PATH 目录下没找到,去下载的时候在github被拒绝了,伟大的墙。习主席说什么来着,智者造桥,愚者造墙。

代码分支了

https://www.npmjs.com/package/phantomjs-prebuilt

npm install phantomjs-prebuilt

node ./install.js

69d257f905304703bfd31b725052d1f9_thumb

/usr/elasticsearch-6.2.3/plugins/elasticsearch-head

vi Gruntfile.js

hostname: '*', #增加此行

ae38acd1bb514c92bd4ce95a4549e3e8_thumb

vi _site/app.js

更新这句

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.209.168:9200";

启动服务

[root@ELK_001 elasticsearch-head]# grunt server

55e2b24094054104a55abcdd4c626fc4_thumb

有文件头

curl -i localhost:9100

12f6fb0a7e344d319d064ca421a122bd_thumb

http://192.168.209.168:9100/

0db29e34958a41bbbce62ece12397f54_thumb

但是集群显示未连接

vi /usr/elasticsearch-6.2.3/config/elasticsearch.yml

http.cors.enabled: true

http.cors.allow-origin: "*"

加两句在启动下就好了

b5ea19a6b9a64ab5b1d0465cf3fc2e6d_thumb

猜你喜欢

转载自blog.51cto.com/433266/2105860
今日推荐