ElasticSearch学习(3)-Head插件-安装

1.安装Node环境

下载安装包: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

2.安装git

yum install git -y

查看git版本:cors

[root@localhost node]# git --version
git version 1.8.3.1

卸载git命令elasticsearch

yum remove git

3.经过git获取head插件

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

4.配置config/elasticsearch.yml文件

在最后添加:

http.cors.enabled: true
http.cors.allow-origin: "*"

5.启动es服务和head插件

切换到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便可

相关文章
相关标签/搜索