这里选择的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
  • open http://localhost:9100/

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

Running as a plugin of Elasticsearch (deprecated)

  • for Elasticsearch 5.x: site plugins are not supported. Run as a standalone server

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这个选项)

转载于:https://www.cnblogs.com/jsonhc/p/7551802.html

ELK之elasticsearch5.6的安装和head插件的安装相关推荐

  1. vscode 安装包_VS Code的下载与安装(更改插件的安装位置)

    vs code下载地址 https://code.visualstudio.com/ 选择适合自己电脑系统的安装包 安装 下载完成后,双击进行安装 选择安装路径(可以选择自己的创建的安装路径,也可以选 ...

  2. 记第一次Ubuntu系统的安装、搜狗输入法的安装与VIM插件的安装(入门篇)

    序 在上完Centos的课程之后,感觉要是想在Linux系统上有更好的学习和突破,应该要开始使用Linux系统,也就是开始安装Linux系统到真实主机上,并开始熟悉Linux系统的使用. 在多次安装过 ...

  3. AE插件怎么安装?ae插件.jsx安装后找不到怎么办?ae插件安装教程

    AE插件怎么安装?AE视频合成软件的功能之所以强大,是因为它装载内置插件和外置插件.内置插件编程人员在开发阶段已注入软件本身,而外置插件需要我们手动添加.有网友疑惑ae插件.jsx安装后找不到怎么办? ...

  4. wordpress主题安装- wordpress主题插件如何安装

    wordpress主题安装,一键批量安装工具,只需要输入域名就能安装各大主题以及源码.同时可以自动SEO优化.实现一键建站+采集+伪原创+发布+主动推送给搜索引擎.一个网站更新频率越高,搜索引擎蜘蛛就 ...

  5. 安装Maltego默认插件

    安装Maltego默认插件 Maltego安装后,一些默认插件需要用户手动安装.否则,对应的Transform则无法使用.在最新版本中,默认仅安装了PATERVA CTAS CE插件.下面将以Shod ...

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

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

  7. 唯一插件化Replugin源码及原理深度剖析--插件的安装、加载原理

    上一篇 唯一插件化Replugin源码及原理深度剖析–唯一Hook点原理 在Replugin的初始化过程中,我将他们分成了比较重要3个模块,整体框架的初始化.hook系统ClassLoader.插件的 ...

  8. editthiscookie插件怎么安装_CSDN专属idea插件上线啦~~

    1.插件介绍 CSDN的idea插件CSDN tools(以下简称tools),tools整合了日常开发中常用的工具,提高开发效率. json格式化 时间格式化 ip查询 计算器 CSDN平台搜索 g ...

  9. linux系统中插件安装失败,Ubuntu 安装Rhythmbox多媒体插件时出现错误

    Ubuntu 12.04下想要看mp4文件,系统提示需要安装Rhythmbox多媒体插件,安装时出现错误,错误代码如下: 下列软件包未满足的依赖关系: gstreamer0.10-ffmpeg: De ...

最新文章

  1. Centos-移动文件或目录-mv
  2. 鸟哥的Linux私房菜(基础篇)- 第二十章、启动流程、模块管理与 Loader
  3. [云炬创业基础笔记]第五章创业机会评估测试1
  4. Marketing Cloud的notification的OData实现
  5. Linux命令中的参数,linux中一些命令以及一些参数的用法
  6. spring框架(三)mvc
  7. (转)告别程序员生涯,一点感慨,与诸君共勉
  8. php 中文key_API常用签名验证方法(PHP实现)
  9. 论坛头条内容链接地址有误
  10. (day 53 - 动态规划 ) 剑指 Offer 63. 股票的最大利润
  11. mysql简述光标_MySQL数据库光标使用介绍
  12. 进行网络数据采集时用 CSS——避免蜜罐
  13. 最新如何将b站视频下载到电脑上不用插件
  14. 20182442-胡名琪
  15. color-thief-php提取图片色值分布及百分占比
  16. 在WordPress中重新排序博客文章的4种简单方法(循序渐进)
  17. 华为鸿蒙公测尝鲜,华为鸿蒙尝鲜测试正式开始,分三种形式
  18. 苦于抖音四季文案久已的朋友们快看过来!
  19. python pdf 转换成txt,csv,doc 及doc转换为pdf初级
  20. 深入剖析ISA防火墙策略执行过程

热门文章

  1. SpringFramework5.0 @Indexed注解 简单解析
  2. redisTemplate.opsForHash()
  3. mysql架构 视频_企业常见MySQL架构应用实战(高可用集群系统+调优经验)视频课程...
  4. 电缆的验证、鉴定和认证应该选择什么测试工具
  5. MYSQL多字段分组having子句
  6. 【阿里内部应用】基于Blink为新商业调控打造实时大数据交互查询服务
  7. SQL Server 连接超时案例一则
  8. linux_check
  9. 绝地求生大逃杀,改配置
  10. Delphi实现的透明阴影以及蒙版效果菜单