elasticsearc5.1.1 安装head插件

一、下载安装包

1,下载elasticsearch-head

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

2,下载node.js二进制版;安装方式见    【centos6.5源码编译安装nodejs】

https://nodejs.org/en/download/current/

二,安装grunt

安装好elasticsearch  和node.js之后  安装grunt

命令: npm install -g grunt-cli

输入“grunt”命令 验证

结果: 

            参考:http://blog.csdn.net/yuchen_0515/article/details/48653061

            官网:http://gruntjs.com/getting-started

三、npm 安装依赖

到elasticsearch-head-master目录下,运行命令:

# npm install  建议耐心等待或者  执行npm install grunt --save-dev

安装过程中如果出现如下错误,不要管,继续往下走:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression

npm ERR! Linux 2.6.32-504.el6.x86_64

npm ERR! argv "/opt/soft/node/bin/node" "/opt/soft/node/bin/npm" "install"

npm ERR! node v7.4.0

npm ERR! npm  v4.1.2

npm ERR! code ELIFECYCLE

npm ERR! phantomjs-prebuilt@2.1.14 install: `node install.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the phantomjs-prebuilt@2.1.14 install script 'node install.js'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!    node install.js

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!    npm bugs phantomjs-prebuilt

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!    npm owner ls phantomjs-prebuilt

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR!    /usr/local/elk/elasticsearch-head-master/npm-debug.log

如果速度较慢或者安装失败,可以使用国内镜像:(执行这个命令成功后往下走还是会报错

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

四、修改Elasticsearch配置文件

编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入以下内容:

http.cors.enabled: true

http.cors.allow-origin: "*"

五、修改Gruntfile.js

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: ‘0.0.0.0’:

  connect: {

          server: {

                    options: {

                                  hostname: '0.0.0.0',

                                  port: 9100,

                                  base: '.',

                                  keepalive: true

                        }

            }

  }

六、启动elasticsearch-head

在elasticsearch-head-master/目录下,运行启动命令:

# grunt server

如果报如下错误,这说明 第三步:npm 安装依赖 出了问题   重新耐心 npm install

# grunt server

grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to

your project. For more information about installing and configuring grunt,

please see the Getting Started guide:

http://gruntjs.com/getting-started

访问9100端口:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 前言 前不久刚乌鸦嘴说完比较闲,就忙成狗,过了很久都没有更新,趁周末赶紧之前总结的经验梳理一下。上次我们说完ELK...
    我的橙子很甜阅读 8,248评论 1 6
  • 写在前面 通过查看官方文档可知,Elasticsearch 5 以上版本已经不支持 site plugins 的方...
    Dandelion丶阅读 5,883评论 0 1
  • 最近项目用到了es搜索引擎,行业对全文搜索引擎方面对es具有高度的评价,es基于目前最流行的开源Luence封装的...
    阿太哥阅读 5,010评论 0 0
  • 高尔基说:"我扑在书上,就像饥饿的人扑在面包上。"刘向说:"书犹药也,善读书可以治愈。"而我要说:"书是我的良师益...
    爱我所爱的阅读 3,411评论 2 2
  • 随意瞥了一眼时间竟然都快十一点半了,而后猛然想起今天的简书还没有更新呢,头脑划过“要不今天就算了吧”的念头,瞬间...
    羲子阅读 1,670评论 0 0

友情链接更多精彩内容