elasticsearch 5.2.0 安装head插件

1,先安装npm工具,安装npm工具需要安装nodejs

wget http://app-zlf.oss-cn-hangzhou.aliyuncs.com/node-v0.12.16.tar.gz
tar zxvf node-v0.12.16.tar.gz
cd node-v0.12.16
./configure
make
make install

2,安装elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm install grunt
grunt server
open http://IP:9100/

3,插件效果图如下

QQ截图20170415005007.png

报错1:
其中一台服务器在npm install时总是报如下错误,

[root@http elasticsearch-head]# npm install
npm WARN package.json elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN engine request@2.79.0: wanted: {"node":">= 4"} (current: {"node":"0.12.16","npm":"2.15.1"})
npm WARN optional dep failed, continuing fsevents@1.1.1
 
> phantomjs-prebuilt@2.1.14 install /home/zlfzy/tmp/elasticsearch-head/node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Error extracting archive
Phantom installation failed { [Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
]
  killed: false,
  code: 2,
  signal: null,
  cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

    at ChildProcess.exithandler (child_process.js:754:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1019:16)
    at Socket.<anonymous> (child_process.js:1190:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:484:11)
npm ERR! Linux 3.10.0-514.6.2.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.16
npm ERR! npm  v2.15.1
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! 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 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!     /home/zlfzy/tmp/elasticsearch-head/npm-debug.log

最后通过以下命令安装成功:

npm install phantomjs-prebuilt@2.1.14 --ignore-scripts

报错2:
有一台服务器在启动./grunt server报如下错误

[root@http bin]# ./grunt server
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?

Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

经过对比发现,elasticsearch-head目录下的node_modules目录里面少了grunt-contrib-jasmine文件夹
后来直接到另一台服务器拷贝这个文件夹以及内容过来,顺利解决。

添加新评论