下載安裝包:node
wget https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz
解壓:linux
tar -xJf node-v8.9.1-linux-x64.tar.xz
配置環境變量:git
vi /etc/profile
添加:github
export JAVA_BIN=$JAVA_HOME/bin export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$NODE_HOME/bin:$PATH
source /etc/profile
當即生效npm
查看版本:瀏覽器
[root@localhost node]# node -v v8.9.1 [root@localhost node]# npm -v 5.5.1
yum install git -y
查看git版本:cors
[root@localhost node]# git --version git version 1.8.3.1
卸載git命令elasticsearch
yum remove git
git clone git://github.com/mobz/elasticsearch-head.git
進入head根目錄,切換到root用戶進行安裝插件
[root@localhost elasticsearch-head]# npm install
啓動head插件code
[es@localhost elasticsearch-head]$ npm run start
在最後添加:
http.cors.enabled: true http.cors.allow-origin: "*"
切換到es用戶下
[es@localhost elasticsearch-head]$ sh ../../elasticsearch-6.1.2/bin/elasticsearch -d [es@localhost elasticsearch-head]$ npm run start
瀏覽器中訪問:http://192.168.15.38:9100/
鏈接es便可