elasticsearch5.5部署head插件

floodwater floodwater     2022-09-15     155

关键词:

请看完再动手,两篇文章都是找来的,合并在一起了,前半部分是参考,我是按照后半部分做的,而且执行中间也有坑。

Elasticsearch5.X及 head插件 安装说明:

1、下载elasticsearch安装文件:

a) 下载官方源码:

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz

b) 解压压缩文件

tar -zxvf elasticsearc-5.0.0.tar.gz

c) 修改es配置文件:elasticsearch.yml

cluster.name: kd-cluster //集群名称,所有主机相同的集群名称用于发现集群节点

node.name: node01 //节点名称

node.master: true //该节点是否用做管理节点

node.data: true //该节点是否用做数据节点

node.attr.rack: r1

path.data: 数据存储路径(文件夹)

path.logs: 日志存储路径(文件夹)

bootstrap.memory_lock: false

network.host: 172.16.8.229 //节点ip地址

http.cors.enabled: true //head插件的配置

http.cors.allow-origin: "*" //head插件的配置

http.port: 9200 //集群访问端口

discovery.zen.ping.unicast.hosts: ["node01"] //配置了互信的话这个位置可以使用节点名称(一般节点名成和计算机名称的相同的)。未配置互信的话使用主机ip,用于发现管理节点。

discovery.zen.minimum_master_nodes: 1 //集群最大管理节点数(防止脑裂的配置)

gateway.recover_after_nodes: 1

*******************如果是虚拟机一台复制的多台ES服务器,需要手工删除复制出来的机器上的目录elasticsearch/data/,否则会提示node id相同而无法加入集群

 

d) 修改主机配置

vi /etc/security/limits.conf :

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

vi /etc/security/limits.d/90-nproc.conf :

* soft nproc 2048

vi /etc/sysctl.conf :

vm.max_map_count=655360

并执行命令:sysctl -p

重启计算机。

2、下载elasticseatch-head插件:

a) 下载head插件文件:

https://github.com/mobz/elasticsearch-head(下载后上传到服务器)

git clone git://github.com/mobz/elasticsearch-head.git(git下载)

b) 下载Node.js:

wget https://nodejs.org/dist/v4.6.1/node-v4.6.1-linux-x64.tar.gz(linux命令直接下载)

https://nodejs.org/dist/(官方网站下载后上传到服务器)

c) 配置node.js环境变量:

vim /etc/profile:

export PATH=/data/elasticsearch/node-v4.6.1-linux-x64/bin:$PATH(根据实际情况添加,路径和格式参照本机环境)

执行source /etc/profile使环境变量生效

(修改profile文件需要root权限,使环境生效的命令在当前es集群使用用户下执行)

d) 查看当前head插件目录下有无node_modules/grunt目录:

没有:执行命令创建:npm install grunt --save

e) 安装head插件:

npm install

或者使用重定向安装:npm install -g cnpm --registry=https://registry.npm.taobao.org

f) 安装grunt:

npm install -g grunt-cli

g) 编辑Gruntfile.js

文件93行添加hostname:’0.0.0.0’

h) 检查head根目录下是否存在base文件夹

没有:将 _site下的base文件夹及其内容复制到head根目录下

i) 启动grunt server:

在head下运行grunt server -d启动head插件

j) 访问head插件:

http://localhost:9100(启动后会有提示:Started connect web server on http://localhost:9100)

 

 

--------------------------5.5 安装HEAD详细步骤------------------

1、git下载软件包

yum -y install git
git clone git://github.com/mobz/elasticsearch-head.git

备注:安装包不要放到elasticsearch/plugins目录下

 

2、node安装

http://www.cnblogs.com/shhnwangjian/p/6559732.html

2.1、下载编译好的文件

1
2
3
yum -y install wget
cd /usr/local/src/
wget http://nodejs.org/dist/v6.9.4/node-v6.9.4-linux-x64.tar.gz

2.2、解压

1
tar -xvf node-v6.9.4-linux-x64.tar.gz

2.3、查看版本信息

1
2
cd /usr/local/src/node-v6.9.4-linux-x64/bin
./node -v

2.4、设置全局

1
2
ln -s /usr/local/src/node-v6.9.4-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/src/node-v6.9.4-linux-x64/bin/npm /usr/local/bin/npm

或者设置NODE_HOME环境变量

1
2
export NODE_HOME=/usr/local/src/node-v6.9.14-linux-x64
export PATH=$NODE_HOME/bin:$PATH

2.5、淘宝镜像cnpm安装  https://npm.taobao.org/

1
2
3
npm install -g cnpm --registry=https://registry.npm.taobao.org
ln -s /usr/local/src/node-v6.9.4-linux-x64/bin/cnpm /usr/local/bin/cnpm
cnpm -v

 

3、安装grunt和grunt-cli

1
2
npm install -g grunt-cli
npm install -g grunt

*****切记验证一下在任何目录下执行grunt是否可以找到命令。 

我反正没有找到,于是最后加了连接搞定的:ln -s /usr/local/es/elasticsearch-head/node_modules/grunt/bin/grunt /usr/local/bin/grunt

 

4、修改Elasticsearch配置文件,加入

/etc/elasticsearch/elasticsearch.yml

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

 

5、修改Gruntfile.js

elasticsearch-head/Gruntfile.js

                connect: {
                        server: {
                                options: {
                                        hostname: ‘0.0.0.0‘,
                                        port: 9100,
                                        base: ‘.‘,
                                        keepalive: true
                                }
                        }
                }

增加hostname属性,设置为0.0.0.0

 

6、修改app.js

elasticsearch-head/_site/app.js

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.10.83.163:9200";

把localhost修改成ES的服务器地址,如上面10.10.83.163

 

7、运行head

进入elasticsearch-head 目录

npm install 

***我在centos 7平台上安装过程中出现以下错误:

1.由于是最新的elasticsearch-head,可能由此提示node版本可能不对,于是我把node从6.9.4换成最新的8.4.0,然后重新做了一遍

2.提示“tar (child): bzip2: Cannot exec: No such file or directory”,于是通过yum安装了bzip2

3.然后死活安装不了phantomjs,估计是安装脚本问题,于是单独安装了npm install phantomjs-prebuilt@2.1.14 --ignore-scripts,最后再npm install通过

启动

grunt server

页面访问:http://10.10.83.163:9100

 

8、后台启动elasticsearch-head

nohup grunt server &

如果想关闭head插件,查找进程命令:

ps aux|grep grunt

 

x-pack安全模块(security机制)

1、修改Elasticsearch配置文件

/etc/elasticsearch/elasticsearch.yml

http.cors.allow-headers: Authorization

 

2、页面访问

http://10.10.83.163:9100/?auth_user=elastic&auth_password=changeme

elasticsearch5.5.1-head插件安装

elasticsearch-head是一个界面化的集群操作和管理工具,可以对集群进行傻瓜式操作。可以通过插件把它集成到ES(首选方式),也可以安装成一个独立WebApp。elasticsearch-head主要有三个方面的操作:显示集群的拓扑,并且能够执行索... 查看详情

elasticsearch5.5-head(代码片段)

修改 elasticsearch/config/elasticsearch.yml添加http.cors.enabled:truehttp.cors.allow-origin:"*"下载elasticsearch-head或者 gitclone 到随便一个文件夹安装nodejs,安装9.0.0以上版本 node-v npm默认安装npm-vcd/p 查看详情

elasticsearch5.5安装部署(代码片段)

Elasticsearch5.5下载https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gzJDK1.8下载http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u18 查看详情

elasticsearch5.5.1插件分类

ElasticSearch5.5.1插件分类附官网介绍:https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/intro.html一、插件介绍插件是以自定义方式来增强Elasticsearch的核心功能。插件可以用来添加自定义映射类型,自定义分析器,本地脚本,自定义发现... 查看详情

elasticsearch5.5部署安装

1.ElasticSearch介绍ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTfulweb接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是第二流行的企业搜索引擎。设... 查看详情

elasticsearch5.5.1插件开发指南

Elasticsearch5.5.1插件开发指南原文地址:https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/plugin-authors.html#_plugin_descriptor_file 本文为博主原创翻译,转载需请示。特别是http://www.mamicode.com/ 码迷  这 查看详情

elasticsearch5.5离线环境的完整安装及配置详情,附kibanaik插件配置及安装包下载路径

此文针对局域网环境(非公网环境),提供ElasticSearch5.5.2的完整安装及配置教程,包括ES的kibana插件、IK中文分词插件安装及配置。另外,文章最后提供安装配置环境涉及到的所有安装包及参考指南,供大家学习。环境准备安装... 查看详情

elasticsearch5.5.2环境搭建

运行elasticsearch5.5.2需要jdk1.8版本以上1.elasticsearch可以去官网或github下载,window系统推荐zip压缩版2.解压后进入bin目录运行elasticsearch.bat启动服务3.访问localhost:9500测试是否成功4.安装中文分词插件:https://github.com/medcl/elasticsearch-analy... 查看详情

elasticsearch5.5.2常用命令

  1、启动    转到elasticsearch-5.5.2in目录:    打开命令行输入:elasticsearch      2、ELasticsearch集群已经启动并且正常运行    curlhttp://127.0.0.1:9200/?pretty        这说明你的ELasticsearch集群已经启动... 查看详情

elasticsearch安装部署以及插件head安装,和使用教程

1.环境初始化最小化安装Centos7.3x86_64操作系统的虚拟机,vcpu2,内存4G或更多,操作系统盘50G,主机名设置规则为linux-hostX.exmaple.com,其中host1和host2为elasticsearch服务器,为保证效果特额外添加一块单独的数据磁盘大小为50G并格式... 查看详情

elasticsearch5.5(代码片段)

1.不能以root用户运行groupaddes         #增加es组useraddes-ges-ppwd         #增加es用户并附加到es组chown-Res:eselasticsearch-5.1.1 查看详情

elasticsearch5.5通过案例学习简单操作(代码片段)

1.建立员工目录ES数据库对象与关系型数据库对象对比RelationalDB->Databases->Tables->Rows->ColumnsElasticsearch->Indices->Types->Documents->Fields语法curl-X<VERB>‘<PROTOCOL>://<HOST>/<PATH>?<QUERY_STRING>‘-d‘<BODY>... 查看详情

elasticsearch5.6.5集群部署及调优head和bigdesk插件安装

一、简介:Elasticsearch是一个基于ApacheLucene的开源搜索引擎。无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进、性能最好的、功能最全的搜索引擎库。Elasticsearch不仅仅是Lucene和全文搜索,我们还能这样去描述它:·&n... 查看详情

elk(elasticsearch5.0)head插件安装配置

elk升级部署到elasticsearch5.0后,安装elasticsearch-head插件遇到一个小问题:版本5.0以后,则不再elasticsearch/bin/plugin-installmobz/elasticsearch-head这种形式安装head插件,而是通过npm管理配置,步骤复杂了点。head官网:https://github.com/mobz/elastic... 查看详情

elasticsearch5.3.x使用head插件

...本跳的比房价还快啊。。。 话说回来,需要部署一套Elasticsearch5.2.1即本月最新推出的ES新力作,发现很多用法已经不一样了。。。 本次首先说Head插件的安装: 1、安装插件head1234567891011#去github上下载headgitclonegit: 查看详情

elk-elasticsearch-6.3.2部署(代码片段)

 参考博客:linux下ElasticSearch.6.2.2集群安装与head、Kibana、X-Pack..插件的配置安装参考博客:ELK5.5.1插件安装实践纪要(head/bigdesk/kopf/cerebo/中文分词插件)参考博客:ELK构建MySQL慢日志收集平台详解参考博客:针对Logstash吞吐量... 查看详情

elasticsearch5.2.x使用head插件连接不上集群

...本跳的比房价还快啊。。。 话说回来,需要部署一套Elasticsearch5.2.1即本月最新推出的ES新力作,发现很多用法已经不一样了。。。 本次首先说Head插件的安装: 1、安装插件head1234567891011#去github上下载headgitclonegit: 查看详情

elasticsearch6.2.4安装x-pack之后使用head插件

4、配置head插件具体安装过程请参考:elasticsearch6.X及head插件部署(完整版)这里需要特别指出的是要在elasticsearhc.yml中添加如下配置:http.cors.enabled:truehttp.cors.allow-origin:"*"http.cors.allow-headers:Authorization,X-Requested-With,Content-Le 查看详情