首先要安装node
本地下载:node-v6.11.0-linux-x64.tar.xz
解压安装
yum install xz -y tar xf node-v6.11.0-linux-x64.tar.xz -C /usr/local/ cd /usr/local/ mv node-v6.11.0-linux-x64/ node
环境变量
vim /etc/profile #添加下面一行 export PATH=$PATH:/usr/local/node/bin #重新读取系统变量 source /etc/profile
验证node和npm
[root@localhost ~]#node -v v6.11.0 [root@localhost ~]#npm -v 3.10.10
安装插件
yum install git -y cd /elk git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head/
npm安装grunt
[root@localhost elasticsearch-head]# npm install -g grunt
/usr/local/node/bin/grunt -> /usr/local/node/lib/node_modules/grunt/bin/grunt
/usr/local/node/lib
└─┬ grunt@1.0.1
├── coffee-script@1.10.0
├─┬ dateformat@1.0.12
│ ├── get-stdin@4.0.1
│ └─┬ meow@3.7.0
│ ├─┬ camelcase-keys@2.1.0
│ │ └── camelcase@2.1.1
│ ├── decamelize@1.2.0
│ ├─┬ loud-rejection@1.6.0
│ │ ├─┬ currently-unhandled@0.4.1
│ │ │ └── array-find-index@1.0.2
│ │ └── signal-exit@3.0.2
│ ├── map-obj@1.0.1
│ ├── minimist@1.2.0
│ ├─┬ normalize-package-data@2.4.0
│ │ ├── hosted-git-info@2.5.0
│ │ ├─┬ is-builtin-module@1.0.0
│ │ │ └── builtin-modules@1.1.1
│ │ ├── semver@5.3.0
│ │ └─┬ validate-npm-package-license@3.0.1
│ │ ├─┬ spdx-correct@1.0.2
│ │ │ └── spdx-license-ids@1.2.2
│ │ └── spdx-expression-parse@1.0.4
│ ├── object-assign@4.1.1
│ ├─┬ read-pkg-up@1.0.1
│ │ ├─┬ find-up@1.1.2
│ │ │ ├── path-exists@2.1.0
│ │ │ └─┬ pinkie-promise@2.0.1
│ │ │ └── pinkie@2.0.4
│ │ └─┬ read-pkg@1.1.0
│ │ ├─┬ load-json-file@1.1.0
│ │ │ ├── graceful-fs@4.1.11
│ │ │ ├─┬ parse-json@2.2.0
│ │ │ │ └─┬ error-ex@1.3.1
│ │ │ │ └── is-arrayish@0.2.1
│ │ │ ├── pify@2.3.0
│ │ │ └─┬ strip-bom@2.0.0
│ │ │ └── is-utf8@0.2.1
│ │ └── path-type@1.1.0
│ ├─┬ redent@1.0.0
│ │ ├─┬ indent-string@2.1.0
│ │ │ └─┬ repeating@2.0.1
│ │ │ └─┬ is-finite@1.0.2
│ │ │ └── number-is-nan@1.0.1
│ │ └── strip-indent@1.0.1
│ └── trim-newlines@1.0.0
├── eventemitter2@0.4.14
├── exit@0.1.2
├─┬ findup-sync@0.3.0
│ └── glob@5.0.15
├─┬ glob@7.0.6
│ ├── fs.realpath@1.0.0
│ ├─┬ inflight@1.0.6
│ │ └── wrappy@1.0.2
│ ├── inherits@2.0.3
│ └── once@1.4.0
├─┬ grunt-cli@1.2.0
│ └── resolve@1.1.7
├── grunt-known-options@1.1.0
├─┬ grunt-legacy-log@1.0.0
│ ├── colors@1.1.2
│ ├─┬ grunt-legacy-log-utils@1.0.0
│ │ ├─┬ chalk@1.1.3
│ │ │ ├── ansi-styles@2.2.1
│ │ │ ├── escape-string-regexp@1.0.5
│ │ │ ├─┬ has-ansi@2.0.0
│ │ │ │ └── ansi-regex@2.1.1
│ │ │ ├── strip-ansi@3.0.1
│ │ │ └── supports-color@2.0.0
│ │ └── lodash@4.3.0
│ ├── hooker@0.2.3
│ ├── lodash@3.10.1
│ └── underscore.string@3.2.3
├─┬ grunt-legacy-util@1.0.0
│ ├── async@1.5.2
│ ├── getobject@0.1.0
│ ├── lodash@4.3.0
│ └─┬ which@1.2.14
│ └── isexe@2.0.0
├── iconv-lite@0.4.18
├─┬ js-yaml@3.5.5
│ ├─┬ argparse@1.0.9
│ │ └── sprintf-js@1.0.3
│ └── esprima@2.7.3
├─┬ minimatch@3.0.4
│ └─┬ brace-expansion@1.1.8
│ ├── balanced-match@1.0.0
│ └── concat-map@0.0.1
├─┬ nopt@3.0.6
│ └── abbrev@1.1.0
├── path-is-absolute@1.0.1
└── rimraf@2.2.8
[root@localhost elasticsearch-head]# npm install -g grunt-cli
/usr/local/node/bin/grunt -> /usr/local/node/lib/node_modules/grunt-cli/bin/grunt
/usr/local/node/lib
└─┬ grunt-cli@1.2.0
├─┬ findup-sync@0.3.0
│ └─┬ glob@5.0.15
│ ├─┬ inflight@1.0.6
│ │ └── wrappy@1.0.2
│ ├── inherits@2.0.3
│ ├─┬ minimatch@3.0.4
│ │ └─┬ brace-expansion@1.1.8
│ │ ├── balanced-match@1.0.0
│ │ └── concat-map@0.0.1
│ ├── once@1.4.0
│ └── path-is-absolute@1.0.1
├── grunt-known-options@1.1.0
├─┬ nopt@3.0.6
│ └── abbrev@1.1.0
└── resolve@1.1.7
#安装完 在执行install
[root@localhost elasticsearch-head]# npm install
npm WARN prefer global coffee-script@1.10.0 should be installed with -g
> phantomjs-prebuilt@2.1.14 install /elk/elasticsearch-head/node_modules/phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Receiving...
Error making request.
Error: connect ETIMEDOUT 52.216.17.104:443
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
Please report this full log at https://github.com/Medium/phantomjs
elasticsearch-head@0.0.0 /elk/elasticsearch-head
├─┬ grunt@1.0.1
│ ├── coffee-script@1.10.0
│ ├─┬ dateformat@1.0.12
│ │ ├── get-stdin@4.0.1
│ │ └─┬ meow@3.7.0
│ │ ├─┬ camelcase-keys@2.1.0
│ │ │ └── camelcase@2.1.1
│ │ ├── decamelize@1.2.0
│ │ ├─┬ loud-rejection@1.6.0
│ │ │ ├─┬ currently-unhandled@0.4.1
│ │ │ │ └── array-find-index@1.0.2
│ │ │ └── signal-exit@3.0.2
│ │ ├── map-obj@1.0.1
│ │ ├── minimist@1.2.0
│ │ ├─┬ normalize-package-data@2.4.0
│ │ │ ├── hosted-git-info@2.5.0
│ │ │ ├─┬ is-builtin-module@1.0.0
│ │ │ │ └── builtin-modules@1.1.1
│ │ │ ├── semver@5.3.0
│ │ │ └─┬ validate-npm-package-license@3.0.1
│ │ │ ├─┬ spdx-correct@1.0.2
│ │ │ │ └── spdx-license-ids@1.2.2
│ │ │ └── spdx-expression-parse@1.0.4
│ │ ├─┬ read-pkg-up@1.0.1
│ │ │ ├─┬ find-up@1.1.2
│ │ │ │ └── path-exists@2.1.0
│ │ │ └─┬ read-pkg@1.1.0
│ │ │ ├─┬ load-json-file@1.1.0
│ │ │ │ ├─┬ parse-json@2.2.0
│ │ │ │ │ └─┬ error-ex@1.3.1
│ │ │ │ │ └── is-arrayish@0.2.1
│ │ │ │ ├── pify@2.3.0
│ │ │ │ └─┬ strip-bom@2.0.0
│ │ │ │ └── is-utf8@0.2.1
│ │ │ └── path-type@1.1.0
│ │ ├─┬ redent@1.0.0
│ │ │ ├─┬ indent-string@2.1.0
│ │ │ │ └─┬ repeating@2.0.1
│ │ │ │ └─┬ is-finite@1.0.2
│ │ │ │ └── number-is-nan@1.0.1
│ │ │ └── strip-indent@1.0.1
│ │ └── trim-newlines@1.0.0
│ ├── eventemitter2@0.4.14
│ ├── exit@0.1.2
│ ├─┬ findup-sync@0.3.0
│ │ └── glob@5.0.15
│ ├─┬ glob@7.0.6
│ │ ├── fs.realpath@1.0.0
│ │ ├─┬ inflight@1.0.6
│ │ │ └── wrappy@1.0.2
│ │ ├── inherits@2.0.3
│ │ └── once@1.4.0
│ ├─┬ grunt-cli@1.2.0
│ │ └── resolve@1.1.7
│ ├── grunt-known-options@1.1.0
│ ├─┬ grunt-legacy-log@1.0.0
│ │ ├─┬ grunt-legacy-log-utils@1.0.0
│ │ │ └── lodash@4.3.0
│ │ ├── hooker@0.2.3
│ │ └── underscore.string@3.2.3
│ ├─┬ grunt-legacy-util@1.0.0
│ │ ├── getobject@0.1.0
│ │ ├── lodash@4.3.0
│ │ └─┬ which@1.2.14
│ │ └── isexe@2.0.0
│ ├── iconv-lite@0.4.18
│ ├─┬ js-yaml@3.5.5
│ │ ├─┬ argparse@1.0.9
│ │ │ └── sprintf-js@1.0.3
│ │ └── esprima@2.7.3
│ ├─┬ minimatch@3.0.4
│ │ └─┬ brace-expansion@1.1.8
│ │ ├── balanced-match@1.0.0
│ │ └── concat-map@0.0.1
│ ├─┬ nopt@3.0.6
│ │ └── abbrev@1.1.0
│ ├── path-is-absolute@1.0.1
│ └── rimraf@2.2.8
├─┬ grunt-contrib-clean@1.0.0
│ ├── async@1.5.2
│ └── rimraf@2.6.1
├─┬ grunt-contrib-concat@1.0.1
│ ├─┬ chalk@1.1.3
│ │ ├── ansi-styles@2.2.1
│ │ ├── escape-string-regexp@1.0.5
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.1.1
│ │ ├── strip-ansi@3.0.1
│ │ └── supports-color@2.0.0
│ └── source-map@0.5.6
├─┬ grunt-contrib-connect@1.0.2
│ ├─┬ connect@3.6.2
│ │ ├─┬ debug@2.6.7
│ │ │ └── ms@2.0.0
│ │ ├─┬ finalhandler@1.0.3
│ │ │ ├── statuses@1.3.1
│ │ │ └── unpipe@1.0.0
│ │ ├── parseurl@1.3.1
│ │ └── utils-merge@1.0.0
│ ├── connect-livereload@0.5.4
│ ├── http2@3.3.6
│ ├─┬ morgan@1.8.2
│ │ ├── basic-auth@1.1.0
│ │ ├── debug@2.6.8
│ │ ├── depd@1.1.0
│ │ ├─┬ on-finished@2.3.0
│ │ │ └── ee-first@1.1.1
│ │ └── on-headers@1.0.1
│ ├─┬ opn@4.0.2
│ │ ├── object-assign@4.1.1
│ │ └─┬ pinkie-promise@2.0.1
│ │ └── pinkie@2.0.4
│ ├── portscanner@1.2.0
│ ├─┬ serve-index@1.9.0
│ │ ├─┬ accepts@1.3.3
│ │ │ └── negotiator@0.6.1
│ │ ├── batch@0.6.1
│ │ ├── debug@2.6.8
│ │ ├── escape-html@1.0.3
│ │ ├─┬ http-errors@1.6.1
│ │ │ └── setprototypeof@1.0.3
│ │ └─┬ mime-types@2.1.15
│ │ └── mime-db@1.27.0
│ └─┬ serve-static@1.12.3
│ ├── encodeurl@1.0.1
│ └─┬ send@0.15.3
│ ├── destroy@1.0.4
│ ├── etag@1.8.0
│ └── fresh@0.5.0
├─┬ grunt-contrib-copy@1.0.0
│ └── file-sync-cmp@0.1.1
├─┬ grunt-contrib-watch@1.0.0
│ ├─┬ gaze@1.1.2
│ │ └─┬ globule@1.2.0
│ │ ├── glob@7.1.2
│ │ └── lodash@4.17.4
│ ├── lodash@3.10.1
│ └─┬ tiny-lr@0.2.1
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├─┬ faye-websocket@0.10.0
│ │ └─┬ websocket-driver@0.6.5
│ │ └── websocket-extensions@0.1.1
│ ├── livereload-js@2.2.2
│ └── qs@5.1.0
├── grunt-karma@2.0.0
├─┬ http-proxy@1.16.2
│ ├── eventemitter3@1.2.0
│ └── requires-port@1.0.0
└─┬ karma@1.3.0
├── bluebird@3.5.0
├─┬ body-parser@1.14.2
│ ├── bytes@2.2.0
│ ├── content-type@1.0.2
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├── http-errors@1.3.1
│ ├── iconv-lite@0.4.13
│ ├── qs@5.2.0
│ ├─┬ raw-body@2.1.7
│ │ ├── bytes@2.4.0
│ │ └── iconv-lite@0.4.13
│ └─┬ type-is@1.6.15
│ └── media-typer@0.3.0
├─┬ chokidar@1.7.0
│ ├─┬ anymatch@1.3.0
│ │ ├── arrify@1.0.1
│ │ └─┬ micromatch@2.3.11
│ │ ├─┬ arr-diff@2.0.0
│ │ │ └── arr-flatten@1.1.0
│ │ ├─┬ braces@1.8.5
│ │ │ ├─┬ expand-range@1.8.2
│ │ │ │ └─┬ fill-range@2.2.3
│ │ │ │ ├── is-number@2.1.0
│ │ │ │ ├── isobject@2.1.0
│ │ │ │ ├─┬ randomatic@1.1.7
│ │ │ │ │ ├─┬ is-number@3.0.0
│ │ │ │ │ │ └── kind-of@3.2.2
│ │ │ │ │ └── kind-of@4.0.0
│ │ │ │ └── repeat-string@1.6.1
│ │ │ ├── preserve@0.2.0
│ │ │ └── repeat-element@1.1.2
│ │ ├─┬ expand-brackets@0.1.5
│ │ │ └── is-posix-bracket@0.1.1
│ │ ├── extglob@0.3.2
│ │ ├── filename-regex@2.0.1
│ │ ├─┬ kind-of@3.2.2
│ │ │ └── is-buffer@1.1.5
│ │ ├─┬ normalize-path@2.1.1
│ │ │ └── remove-trailing-separator@1.0.2
│ │ ├─┬ object.omit@2.0.1
│ │ │ ├─┬ for-own@0.1.5
│ │ │ │ └── for-in@1.0.2
│ │ │ └── is-extendable@0.1.1
│ │ ├─┬ parse-glob@3.0.4
│ │ │ ├── glob-base@0.3.0
│ │ │ └── is-dotfile@1.0.3
│ │ └─┬ regex-cache@0.4.3
│ │ ├── is-equal-shallow@0.1.3
│ │ └── is-primitive@2.0.0
│ ├── async-each@1.0.1
│ ├── glob-parent@2.0.0
│ ├─┬ is-binary-path@1.0.1
│ │ └── binary-extensions@1.8.0
│ ├─┬ is-glob@2.0.1
│ │ └── is-extglob@1.0.0
│ └─┬ readdirp@2.1.0
│ ├─┬ readable-stream@2.0.6
│ │ ├── isarray@1.0.0
│ │ ├── process-nextick-args@1.0.7
│ │ └── util-deprecate@1.0.2
│ └── set-immediate-shim@1.0.1
├── colors@1.1.2
├─┬ combine-lists@1.0.1
│ └── lodash@4.17.4
├── core-js@2.4.1
├── di@0.0.1
├─┬ dom-serialize@2.2.1
│ ├── custom-event@1.0.1
│ ├── ent@2.2.0
│ ├── extend@3.0.1
│ └── void-elements@2.0.1
├─┬ expand-braces@0.1.2
│ ├── array-slice@0.2.3
│ ├── array-unique@0.2.1
│ └─┬ braces@0.1.5
│ └─┬ expand-range@0.1.1
│ ├── is-number@0.1.1
│ └── repeat-string@0.2.2
├── graceful-fs@4.1.11
├── isbinaryfile@3.0.2
├─┬ log4js@0.6.38
│ ├─┬ readable-stream@1.0.34
│ │ ├── core-util-is@1.0.2
│ │ ├── isarray@0.0.1
│ │ └── string_decoder@0.10.31
│ └── semver@4.3.6
├── mime@1.3.4
├─┬ optimist@0.6.1
│ ├── minimist@0.0.10
│ └── wordwrap@0.0.3
├── qjobs@1.1.5
├── range-parser@1.2.0
├── rimraf@2.6.1
├─┬ socket.io@1.4.7
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├─┬ engine.io@1.6.10
│ │ ├─┬ accepts@1.1.4
│ │ │ ├─┬ mime-types@2.0.14
│ │ │ │ └── mime-db@1.12.0
│ │ │ └── negotiator@0.4.9
│ │ ├── base64id@0.1.0
│ │ ├─┬ debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ ├─┬ engine.io-parser@1.2.4
│ │ │ ├── after@0.8.1
│ │ │ ├── arraybuffer.slice@0.0.6
│ │ │ ├── base64-arraybuffer@0.1.2
│ │ │ ├── blob@0.0.4
│ │ │ ├─┬ has-binary@0.1.6
│ │ │ │ └── isarray@0.0.1
│ │ │ └── utf8@2.1.0
│ │ └─┬ ws@1.0.1
│ │ ├── options@0.0.6
│ │ └── ultron@1.0.2
│ ├─┬ has-binary@0.1.7
│ │ └── isarray@0.0.1
│ ├─┬ socket.io-adapter@0.4.0
│ │ ├─┬ debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ └─┬ socket.io-parser@2.2.2
│ │ ├── debug@0.7.4
│ │ ├── isarray@0.0.1
│ │ └── json3@3.2.6
│ ├─┬ socket.io-client@1.4.6
│ │ ├── backo2@1.0.2
│ │ ├── component-bind@1.0.0
│ │ ├── component-emitter@1.2.0
│ │ ├─┬ debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ ├─┬ engine.io-client@1.6.9
│ │ │ ├── component-inherit@0.0.3
│ │ │ ├─┬ debug@2.2.0
│ │ │ │ └── ms@0.7.1
│ │ │ ├── has-cors@1.1.0
│ │ │ ├── parsejson@0.0.1
│ │ │ ├── parseqs@0.0.2
│ │ │ ├── xmlhttprequest-ssl@1.5.1
│ │ │ └── yeast@0.1.2
│ │ ├── indexof@0.0.1
│ │ ├── object-component@0.0.3
│ │ ├─┬ parseuri@0.0.4
│ │ │ └─┬ better-assert@1.0.2
│ │ │ └── callsite@1.0.0
│ │ └── to-array@0.1.4
│ └─┬ socket.io-parser@2.2.6
│ ├── benchmark@1.0.0
│ ├── component-emitter@1.1.2
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ ├── isarray@0.0.1
│ └── json3@3.3.2
├─┬ tmp@0.0.28
│ └── os-tmpdir@1.0.2
└─┬ useragent@2.2.1
└── lru-cache@2.2.4
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.1.2: 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-431.el6.x86_64
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
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! /elk/elasticsearch-head/npm-debug.log
#如果npm install 报错(网络问题),使用下面命令安装
[root@localhost elasticsearch-head]# npm install phantomjs-prebuilt@2.1.14 --ignore-scripts
elasticsearch-head@0.0.0 /elk/elasticsearch-head
└─┬ phantomjs-prebuilt@2.1.14
├── es6-promise@4.0.5
├─┬ extract-zip@1.5.0
│ ├─┬ concat-stream@1.5.0
│ │ └── typedarray@0.0.6
│ ├── debug@0.7.4
│ ├─┬ mkdirp@0.5.0
│ │ └── minimist@0.0.8
│ └─┬ yauzl@2.4.1
│ └─┬ fd-slicer@1.0.1
│ └── pend@1.2.0
├─┬ fs-extra@1.0.0
│ ├── jsonfile@2.4.0
│ └── klaw@1.3.1
├─┬ hasha@2.2.0
│ └── is-stream@1.1.0
├── kew@0.7.0
├── progress@1.1.8
├─┬ request@2.79.0
│ ├── aws-sign2@0.6.0
│ ├── aws4@1.6.0
│ ├── caseless@0.11.0
│ ├─┬ combined-stream@1.0.5
│ │ └── delayed-stream@1.0.0
│ ├── forever-agent@0.6.1
│ ├─┬ form-data@2.1.4
│ │ └── asynckit@0.4.0
│ ├─┬ har-validator@2.0.6
│ │ ├── commander@2.11.0
│ │ └─┬ is-my-json-valid@2.16.0
│ │ ├── generate-function@2.0.0
│ │ ├─┬ generate-object-property@1.2.0
│ │ │ └── is-property@1.0.2
│ │ ├── jsonpointer@4.0.1
│ │ └── xtend@4.0.1
│ ├─┬ hawk@3.1.3
│ │ ├── boom@2.10.1
│ │ ├── cryptiles@2.0.5
│ │ ├── hoek@2.16.3
│ │ └── sntp@1.0.9
│ ├─┬ http-signature@1.1.1
│ │ ├── assert-plus@0.2.0
│ │ ├─┬ jsprim@1.4.0
│ │ │ ├── assert-plus@1.0.0
│ │ │ ├── extsprintf@1.0.2
│ │ │ ├── json-schema@0.2.3
│ │ │ └── verror@1.3.6
│ │ └─┬ sshpk@1.13.1
│ │ ├── asn1@0.2.3
│ │ ├── assert-plus@1.0.0
│ │ ├── bcrypt-pbkdf@1.0.1
│ │ ├─┬ dashdash@1.14.1
│ │ │ └── assert-plus@1.0.0
│ │ ├── ecc-jsbn@0.1.1
│ │ ├─┬ getpass@0.1.7
│ │ │ └── assert-plus@1.0.0
│ │ ├── jsbn@0.1.1
│ │ └── tweetnacl@0.14.5
│ ├── is-typedarray@1.0.0
│ ├── isstream@0.1.2
│ ├── json-stringify-safe@5.0.1
│ ├── oauth-sign@0.8.2
│ ├── qs@6.3.2
│ ├── stringstream@0.0.5
│ ├─┬ tough-cookie@2.3.2
│ │ └── punycode@1.4.1
│ ├── tunnel-agent@0.4.3
│ └── uuid@3.1.0
└─┬ request-progress@2.0.1
└── throttleit@1.0.0
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.1.2: 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
还需要修改2个配置文件
[root@localhost elasticsearch-head]# vim Gruntfile.js
#找到connect-server-options选项 添加一条hostname
.....
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
......
[root@localhost elasticsearch-head]# vim _site/app.js
#搜索 9200 ,把连接地址修改为你的ip
......
init: function(parent) {
this._super();
this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.113.123.102:9200";
if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
// XHR request fails if the URL is not ending with a "/"
this.base_uri += "/";
}
......
启动插件【有报错的话】
[root@localhost elasticsearch-head]# grunt server & [1] 2261 [root@localhost elasticsearch-head]# >> 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 #解决 npm install grunt-contrib-jasmine #【再次启动成功】 [root@localhost elasticsearch-head]# grunt server & [1] 2287 [root@localhost elasticsearch-head]# Running "connect:server" (connect) task Waiting forever... Started connect web server on http://localhost:9100
访问查看
访问成功,但是提示集群健康值:未连接
解决:
#切换elk用户,修改配置文件 [elk@localhost ~]$ vim /elk/elasticsearch/config/elasticsearch.yml #添加2行 http.cors.enabled: true http.cors.allow-origin: "*" 重启下,再次访问

