您的位置:首页 > 其它

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

2018-01-27 00:00 786 查看

1.安装Node环境

下载安装包:

wget https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz

解压:

tar -xJf node-v8.9.1-linux-x64.tar.xz

配置环境变量:

vi /etc/profile

添加:

export JAVA_BIN=$JAVA_HOME/bin
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$NODE_HOME/bin:$PATH

source /etc/profile

立即生效

查看版本:

[root@localhost node]# node -v
v8.9.1
[root@localhost node]# npm -v
5.5.1

2.安装git

yum install git -y

查看git版本:

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

卸载git命令

yum remove git

3.通过git获取head插件

git clone git://github.com/mobz/elasticsearch-head.git

进入head根目录,切换到root用户进行安装

[root@localhost elasticsearch-head]# npm install

启动head插件

[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即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ElasticSearch