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. zouxy09-图像卷积与滤波的一些知识点

    原文地址 图像卷积与滤波的一些知识点 zouxy09@qq.com http://blog.csdn.net/zouxy09 之前在学习CNN的时候,有对卷积进行一些学习和整理,后来就烂尾了,现在稍微 ...

  2. 移动APP项目总结

    刚开始做这个项目,看着觉得内容不多,但细节问题很多,很多容易出错的地方, 如下: 项目效果 起初是这样做的 HTML: <div class="seller"> < ...

  3. 使用python爬虫爬取股票数据

    前言: 编写一个爬虫脚本,用于爬取东方财富网的上海股票代码,并通过爬取百度股票的单个股票数据,将所有上海股票数据爬取下来并保存到本地文件中 系统环境: 64位win10系统,64位python3.6, ...

  4. 【PPT大放送】MPD软件工作坊北京站圆满落幕 深圳站即将开幕!

    MPD工作坊深圳站体验票开启啦!文末有彩蛋哦! 7月14日至15日,由麦思博(msup)有限公司举办的第40届MPD软件工作坊在北京国家会议中心举行. 麦思博(msup)有限公司一直专注于软件研发中心 ...

  5. tensorflow如何正确加载预训练词向量

    使用预训练词向量和随机初始化词向量的差异还是挺大的,现在说一说我使用预训练词向量的流程. 一.构建本语料的词汇表,作为我的基础词汇 二.遍历该词汇表,从预训练词向量中提取出该词对应的词向量 三.初始化 ...

  6. A little issue in Mathematical Thought from Ancient to Modern Times, Vol. 3

    At P985 of the book, says But there are cuts that are not determined by rational numbers. If we put ...

  7. debian安装nodejs

    https://nodejs.org/en/download/ 二进制安装 sudo wget https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux ...

  8. [httpd] httpd directory list character encoding

    在httpd下放置文件用来直接从浏览器访问的时候,中文文件名有可能产生乱码. 做以下设置,调整字符编码: 1: Add this to your .htaccess: IndexOptions +Ch ...

  9. sql server 按外键分组查询

    SELECT ROW_NUMBER() over(partition by a.yngrbsh order by a.SFRQ desc ) RN, c.' and a.LSH not in(sele ...

  10. LeetCode 973 K Closest Points to Origin 解题报告

    题目要求 We have a list of points on the plane.  Find the K closest points to the origin (0, 0). (Here, ...