这里选择的elasticsearch为5.6的新版本,根据官方文档有几种暗装方式:

https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

这里选择rpm包安装https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html

1、wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.rpm

2、查看有哪些配置文件

[root@node1 ~]# cd /etc/elasticsearch/
[root@node1 elasticsearch]# ll
总用量 20
-rw-rw----. 1 root elasticsearch 3024 9月 19 14:00 elasticsearch.yml
-rw-rw----. 1 root elasticsearch 3123 9月 18 10:38 jvm.options
-rw-rw----. 1 root elasticsearch 4456 9月 7 11:12 log4j2.properties
drwxr-x---. 2 root elasticsearch 4096 9月 7 11:12 scripts

 elasticsearch常用配置在elasticsearch.yml文件中,关于jvm的一些配置在jvm.options文件中,日志的配置在log4j2.properties文件中

[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml
cluster.name: my-elastic
node.name: node1
network.host: 0.0.0.0
http.port: 9200

 简单配置之后然后启动服务:/etc/init.d/elasticsearch start

默认日志文件为/var/log/elasticsearch/目录下,启动有报错都可以根据报错解决

这里将一些遇到的报错及解决方法列一些出来:

1、max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
解决:

[root@node1 elasticsearch]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning. * soft nproc 2048
root soft nproc unlimited
2、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf配置文件,
cat /etc/sysctl.conf | grep vm.max_map_count
vm.max_map_count=262144
如果不存在则添加
echo "vm.max_map_count=262144" >>/etc/sysctl.conf
 
3、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
 
ulimit -n 65536
 
4、启动异常:ERROR: bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
问题原因:因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动
解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false 添加此行
 
现在整个elasticsearch.yml配置如下:
[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml
cluster.name: my-elastic
node.name: node1
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.port: 9200

 重新启动elasticsearch服务,查看日志是否报错,如没有报错,浏览器进行访问是否有效:

现在为elasticsearch安装上插件head,利用github找到head插件:

https://github.com/mobz/elasticsearch-head,根据文中说明:

There are multiple ways of running elasticsearch-head.

Running with built in server

  • git clone git://github.com/mobz/elasticsearch-head.git
  • cd elasticsearch-head
  • npm install
  • npm run start

This will start a local webserver running on port 9100 serving elasticsearch-head

Running as a plugin of Elasticsearch (deprecated)

elasticsearch5.x以上需要安装head插件需要作为一个单独的服务,步骤如上,于是开始安装:

如果没有npm命令需要首先安装上:  

  安装npm:
     yum install npm                       epel源提供的
 
添加npm源:
  npm install -g cnpm --registry=https://registry.npm.taobao.org
直接将本地的npm仓库指向淘宝的镜像地址
  npm config set registry https://registry.npm.taobao.org
 
开始安装head插件:
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start

 默认监听在0.0.0.0,不需要修改监听地址

这里有两种启动方式:

  1、npm run start(仓库拉取下来的elasticsearch-head目录下执行)

2、[root@node1 elasticsearch-head]# ./node_modules/grunt/bin/grunt server

启动后都是如下效果:

[root@node1 elasticsearch-head]# ./node_modules/grunt/bin/grunt server
Loading "watch.js" tasks...ERROR
>> Error: Cannot find module 'http-parser-js' Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

 查看日志:

[2017-09-19T13:50:36,288][INFO ][o.e.p.PluginsService ] [node1] no plugins loaded
[2017-09-19T13:50:38,401][INFO ][o.e.d.DiscoveryModule ] [node1] using discovery type [zen]
[2017-09-19T13:50:39,079][INFO ][o.e.n.Node ] [node1] initialized
[2017-09-19T13:50:39,079][INFO ][o.e.n.Node ] [node1] starting ...
[2017-09-19T13:50:39,239][INFO ][o.e.t.TransportService ] [node1] publish_address {192.168.44.134:9300}, bound_addresses {[::]:9300}

9100端口已经监听了,访问浏览器http://192.168.44.134:9100却依然连接不到集群,然后谷歌到需要进行设置:

check http.cors.enabled and http.cors.allow-origin are set in config/elasticsearch.yml in order to enable cors.
Reference : https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html

然后配置elastic,具体配置如下:

[root@node1 elasticsearch]# grep -v "^#" /etc/elasticsearch/elasticsearch.yml
cluster.name: my-elastic
node.name: node1
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
http.port: 9200

 重启服务之后,浏览器访问

至此elasticsearch5.6版本安装head插件成功!!!

插件head的一些配置,如果node1不是监听在0.0.0.0而是ip:

还有一个配置文件:(我这里没有hostname这个选项)

ELK之elasticsearch5.6的安装和head插件的安装的更多相关文章

  1. elasticsearch5.0以上版本及head插件的安装

    本文转载至:https://www.cnblogs.com/hts-technology/p/8477258.html(针对5.0以上版本) 对于es5.0以下的版本可以参考:https://www. ...

  2. 批量搞机(二):分布式ELK平台、Elasticsearch介绍、Elasticsearch集群安装、ES 插件的安装与使用

    一.分布式ELK平台 ELK的介绍: ELK 是什么? Sina.饿了么.携程.华为.美团.freewheel.畅捷通 .新浪微博.大讲台.魅族.IBM...... 这些公司都在使用 ELK!ELK! ...

  3. 转:ElasticSearch的安装和相关插件的安装

    原文来自于:http://blog.csdn.net/whxaing2011/article/details/18237733 本文主要介绍如下内容:          1.ElasticSearch ...

  4. ElasticSearch 5.2.2 安装及 head 插件的安装

    ElasticSearch 是一个基于 Lucene 的高度可扩展的开源全文搜索和分析引擎.它能够做到可以快速.实时地存储.搜索和分析大量数据.它通常作为底层引擎/技术,为具有复杂搜索功能和要求的应用 ...

  5. Ubuntu16.04下安装googlechrome flash 插件和安装网易云音乐

    一.ubuntu 16.04 下安装完后发现 flash无法播放没有安装flash插件因为 Adobe Flash 不再支持 linux Google 便开发了PepperFlashPlayer来替代 ...

  6. eclipse安装反编译插件

    1. 进入http://jadclipse.sourceforge.net/wiki/index.php/Main_Page#Download          下载 net.sf.jadclipse ...

  7. 解决WordPress无法上传媒体文件以及无法下载和安装主题与插件的问题

    前言: 我的个人博客网站荒原之梦在安装成功WordPress之后本来是可以上传媒体文件,安装主题和插件的,但是后来不知道怎么回事就出了问题:不能上传媒体文件也不能安装主题和插件了.出现这个问题后我尝试 ...

  8. 04 sublime text 3在线安装package control插件,之后安装主题插件和ConvertToUTF8 插件

    前提:需要@@科学@@上网 在线安装包通常都需要@@科学@@上网 安装package control插件 在线安装package control插件 按ctrl+shift+p 输入install,选 ...

  9. elasticsearch5.0集群+kibana5.0+head插件插件的安装

    elasticsearch5.0集群+kibana5.0+head插件插件的安装 es集群的规划: 两台16核64G内存的服务器: yunva_etl_es1  ip:1.1.1.1 u04es01. ...

随机推荐

  1. 【BZOJ4872】[Shoi2017]分手是祝愿 数学+期望DP

    [BZOJ4872][Shoi2017]分手是祝愿 Description Zeit und Raum trennen dich und mich. 时空将你我分开.B 君在玩一个游戏,这个游戏由 n ...

  2. 探讨Java I/O类和接口

    (输出)Output:程序---->数据源(如某个文件) (输入)Input:数据源---->程序 Java.io定义的I/O类如下表所示: BufferedInputStream Buf ...

  3. 20165330 2017-2018-2 《Java程序设计》第1周学习总结

    教材学习内容总结 java的历史,地位,特点. java的平台介绍 java应用程序的开发及源文件的编写规则 java反编译特点 安装JDK Windows上 在安装JDK后设置系统环境变量,因为我的 ...

  4. 统计学习方法笔记 -- KNN

    K近邻法(K-nearest neighbor,k-NN),这里只讨论基于knn的分类问题,1968年由Cover和Hart提出,属于判别模型 K近邻法不具有显式的学习过程,算法比较简单,每次分类都是 ...

  5. <2014 12 28> Some conclusions and thought recently

    Since last year August when I started to prepare for the IELTS examiation, it took one year's time f ...

  6. Yii框架2.0的安装过程

    Yii框架是个不错的php开发框架,大型项目上都可以使用.和大多框架一样他也是开源,而且采用了mvc结构的. Yii1.*,直接下载然后用脚步可以创建自己的项目了,最近看了下Yii2.0版本的,他推荐 ...

  7. 项目删除又重新clone,未重新进入项目目录或重启terminal,导致git命令或其他命令报 目录不存在的错误

    有一点要注意的是,clone下来如果git项目文件夹被覆盖一次,需要终端cd .. 然后重新进入该目录,否则git会: fatal: Unable to read current working di ...

  8. python全栈开发从入门到放弃之装饰器函数

    什么是装饰器#1 开放封闭原则:对扩展是开放的,对修改是封闭的#2 装饰器本身可以是任意可调用对象,被装饰的对象也可以是任意可调用对象#3 目的:''' 在遵循 1. 不修改被装饰对象的源代码 2. ...

  9. centos7命令1

    ls  查看当前路径下的文件或文件夹 pwd 查看当前路径,例如/home/python   表示根目录下的home文件夹下的python文件夹 clear清空屏幕 /斜杠 \反斜杠 |竖杠 _下划线 ...

  10. 安装mysql8.0.11以及修改root密码、连接navicat for mysql。

    最近在学习node.js,少不得要跟数据库打交道,于是打算安装一个数据库软件,在mongedb和mysql之间选择了mysql.作为一个数据库新人不敢评论孰好孰坏,最后选择mysql纯属因为公司在用m ...