一、环境
- centos7
- elastichsearch-6.2.2
- node v8.11.3
二、nodejs的下载安装
其中,系统安装这里不讲了,elastichsearch-6.2.2安装教程在这里。
安装elasticsearch-head插件需要nodejs的支持,所以此处讲解一下安装nodejs步骤。
1.安装包下载
到nodejs官网现在最新nodejs,官网下载地址:https://nodejs.org/en/download/
当然,也可以直接使用命令下载:
[root@hadoop02 ~]# wget https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz
2.下载完成之后,进行解压安装:
这个文件是tar.xz文件,要分两步解压。
[root@hadoop02 node]# xz -d node-v8.11.3-linux-x64.tar.xz
...
[root@hadoop02 node]# tar -xvf node-v8.11.3-linux-x64.tar
...
3.在/etc/profile中配置好path环境变量
[root@hadoop02 node]# vim /etc/profile
以自己安装的目录地址为准
export PATH=${
JAVA_HOME}/bin:$PATH:/opt/node/node-v8.11.3-linux-x64/bin
4.执行node -v验证安装
[root@hadoop02 node]# node -v
v8.11.3
[root@hadoop02 node]#
三、elastichsearch-head插件的下载安装
1.下载
- 地址:https://github.com/mobz/elasticsearch-head
它在git上面,要按照步骤来安装。 - 首先,安装git :
yum install git
- 安装插件:
clone elasticsearch-head: git clone https://github.com/mobz/elasticsearch-head.git
2.安装elastichsearch-head插件
- 进入elasticsearch-head目录下,执行
npm install
命令。 - 然后执行命令
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
3.启动elastichsearch-head
- npm run start
- 验证elasticsearch-head,在浏览器中输入主机地址和端口(默认端口号是9100)如下图所示:
提示:请先启动elastichsearch再去验证。