1、环境

Linux centos7

elasticsearch-head的zip包,github网址如下:https://github.com/mobz/elasticsearch-head

nodejs的linux对应位数下载:https://nodejs.org/en/download/

2、安装nodejs

解压后如下图所示:

进入bin执行下面的三个可执行文件:

[root@mycentos bin]# ./node -v
[root@mycentos bin]# ./npm -v
[root@mycentos bin]# ./npx -v

执行./npm -v会报错如下:

/usr/bin/env: node: 没有那个文件或目录

此时需要配置环境变量即可,修改/etc/profile,行尾追加如下命令:

[root@mycentos ~]# vim /etc/profile

export NODE_HOME=/opt/nodejs/node-v8.9.4-linux-x64/
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

#执行命令生效:

[root@mycentos ~]# source /etc/profile

3、安装elasticsearch-head

进入到elasticsearch-head主目录执行:

[elastic@mycentos elasticsearch-head-master]$   npm install

安装过程中出现错误:

Please report this full log at https://github.com/Medium/phantomjs

npm ERR! Darwin 15.0.0

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"

npm ERR! node v4.4.3

npm ERR! npm  v3.10.9

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 install phantomjs-prebuilt@2.1. --ignore-scripts

最终安装成功!成功后当前目录多了一个node_modules文件夹。

4、配置

(1)配置Head主目录下的Gruntfile.js,默认文件中是没有hostname属性的,我们需要手动添加:

connect: {
server: {
options: {
port: 9100,
base: '.',
keepalive: true,
hostname: '*'
}
}
}

(2)配置elasticsearch 的启动配置文件:

为什么需要修改配置文件:

head插件连接elasticsearch需要注意的点:

因为head插件是一个独立进程,启动后是一个独立的服务器外加端口,比如我的虚拟机ip地址:http://192.168.0.111:9100/

而elasticsearch启动后也是一个独立的进程,ip地址:http://192.168.0.111:9200/

这样两个独立进程,虽然服务器ip地址相同,但是端口不同,此时会发生跨域的情况。。

于是官方给出这样一段话,我们在对elasticsearch启动的时候追加两个配置文件属性即可防止跨域。

#在文件末尾添加即可

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

5、启动Head插件

#切回到head的主目录下,执行如下命令

[elastic@mycentos elasticsearch-head-master]$ npm run start

然后在浏览中打开:http://localhost:9100

安装完毕!

ElasticSearch6.2.3安装Head插件的更多相关文章

  1. (新)elasticsearch6.0版本安装head插件

    ES6.0版本安装head插件 1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持 ...

  2. elasticsearch6.0版本安装head插件

    ES6.0版本安装head插件 1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持 ...

  3. ES之一:Elasticsearch6.4 windows安装 head插件ik分词插件安装

    准备安装目标:1.Elasticsearch6.42.head插件3.ik分词插件 第一步:安装Elasticsearch6.4 下载方式:1.官网下载 https://www.elastic.co/ ...

  4. (转)elasticsearch6.0版本安装head插件

    1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持命令行安装head插件了,反正我 ...

  5. Elasticsearch6.2.1安装elasticsearch-sq插件

    参考 https://github.com/NLPchina/elasticsearch-sql 1.下载插件 wget https://github.com/NLPchina/elasticsear ...

  6. ELK(Elasticsearch6.0以上版本head插件安装)

    参考:https://www.cnblogs.com/Onlywjy/p/Elasticsearch.html Elasticsearch6.0不能使用命令直接安装head插件 修改配置文件/etc/ ...

  7. elasticsearch6.6.0安装配置及elasticsearch-head插件安装

    一.最小化安装centos7.6 cat /etc/redhat-release 二.配置网络,可以上外网 三.安装常用命令工具,修改系统时区,校对系统时间,关闭selinux,关闭firewalld ...

  8. windows下安装elasticsearch-6.4.3和elasticsearch-head插件

    windows下安装elasticsearch-6.4.3和elasticsearch-head插件 博客分类: elasticsearch es  ElasticSearch下载地址:https:/ ...

  9. elasticsearch-6.0.1安装

    elasticsearch-6.0.1安装 0. 介绍:     ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎:是目前全文搜索引擎的首选. ...

随机推荐

  1. C# MVC+EF—结构搭建

    近期做了MVC+EF的项目,现在项目完结了,抽个时间写个小DOM总结一下,顺便加深理解. 一.新建MVC项目,结构是这样的

  2. http://linux-mtd.infradead.org/doc/nand.html nand

    http://linux-mtd.infradead.org/doc/nand.html

  3. InputStream只能读取一次的解决办法 C# byte[] 和Stream转换

    x 情景--->>> 导入文件的时候,前台传过来一个文件, 后台接到: HttpPostedFileBase file = Request.Files[];由于对这个文件后台处理比较 ...

  4. ML.NET教程之情感分析(二元分类问题)

    机器学习的工作流程分为以下几个步骤: 理解问题 准备数据 加载数据 提取特征 构建与训练 训练模型 评估模型 运行 使用模型 理解问题 本教程需要解决的问题是根据网站内评论的意见采取合适的行动. 可用 ...

  5. .NET Core 中 IOptions 有什么用

    我只发现IOptions的一个用处——方便了在.NET Core应用程序中使用强类型配置. 如果没有IOptions,使用强类型配置需要自己解决下面2个问题: 1)将配置文件(比如appsetting ...

  6. mysql索引及sql执行顺序

    1, 红黑树 同一层级的黑树到根结点经历的黑树数目一样 最坏情况的时间复杂度 lg n 是二叉树b树 结点可以有多个孩子 b+树 父节点不存储数据聚集索引)的叶子节点会存储数据行,也就是说数据和索引是 ...

  7. PPT文件分析摘记

    将.pptx文件后缀改成.rar,然后解压 ppt文件夹下面是资源 [Content_Types].xml  展示是布局和内容说明的入口xml(显示的页面.页面对应的布局.内容.样式文件的路径),里面 ...

  8. DBGridEh使用指南改变边框颜色

    DBGridEh使用指南 鹅倌0人评论422人阅读2012-08-06 15:17:59   1.设置表头,是否允许多表头,设置是否只读. dbgrdh1.TitleFont.Color:=clBlu ...

  9. LeetCode 824 Goat Latin 解题报告

    题目要求 A sentence S is given, composed of words separated by spaces. Each word consists of lowercase a ...

  10. Idea下载安装

    安装 下载 下载地址:http://www.jetbrains.com/idea/#chooseYourEdition,选择付费版的zip格式的下载 安装过程中除了勾选64版本之外其他一路next,直 ...