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
新版本不支持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 –
再来
yum install -y nodejs
yum install -y gcc-c++ make
就有了,17M
验证下安装
node -v
npm -v
使用国内淘宝源安装grunt
cd elasticsearch-head/
npm install -g grunt –registry=https://registry.npm.taobao.org
npm install grunt –save
看看安装好了么
ls -d node_modules/grunt
npm install -g grunt-cli –registry=https://registry.npm.taobao.org
npm install –registry=https://registry.npm.taobao.org
出错鸟,连接被拒绝了,容我修个错误
PhantomJS not found on PATH 目录下没找到,去下载的时候在github被拒绝了,伟大的墙。习主席说什么来着,智者造桥,愚者造墙。
代码分支了
https://www.npmjs.com/package/phantomjs-prebuilt
npm install phantomjs-prebuilt
node ./install.js
/usr/elasticsearch-6.2.3/plugins/elasticsearch-head
vi Gruntfile.js
hostname: ‘*’, #增加此行
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
有文件头
curl -i localhost:9100
http://192.168.209.168:9100/
但是集群显示未连接
vi /usr/elasticsearch-6.2.3/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: “*”
加两句在启动下就好了
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/193699.html