1. Elasticstack官网:https://www.elastic.co
  2. 本文档仅限搭建过程参考,使用相关的文档,不在本文档讨论范围之内。
  3. 一切依据的核心即是Elasticstack官网。
  4.  
  5. 查看支持的操作系统:
  6. Elasticstack各版本软件支持的系统等:https://www.elastic.co/support/matrix#show_os
  7. 必备软件:
  8. Elasticsearchelasticsearch-5.3.0.tar.gz
  9. Logstashlogstash-5.3.0.tar.gz
  10. Kibanakibana-5.3.0-linux-x86_64.tar.gz
  11. Beatsfilebeat-5.3.0-linux-x86_64.tar.gz
  12. X-packx-pack-5.3.0.zip
  13. jdk1.8jdk-8u121-linux-i586.tar
  14. 搭建流程:
  15. Elasticsearch
  16. https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
  17. 修改时区(如必要):
  18. cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  19. 安装JDK1.8,先安装yum install -y glibc.i686
  20. root权限下
  21. sysctl -w vm.max_map_count=262144
  22. /etc/security/limits.conf 增加
  23. * soft nproc 2048 (第一列为Linux账户名)
  24. * hard nproc 4096(第一列为Linux账户)
  25. * soft nofile 65536
  26. * hard nofile 131072
  27. /etc/security/limits.d/90-nproc.conf 修改
  28. * soft nproc 2048
  29. sudo sysctl -p
  30. 生产环境需要的配置
  31. Elasticsearch通过name判断所属的集群
  32. path.data and path.logs
  33. 不要和安装目录放一起,防止升级的时候数据丢失
  34. 可以配置多个目录
  35. cluster.name
  36. 各节点通过cluster.name加入集群
  37. node.name
  38. 保证重启机器名称不变
  39. 可以设置成机器名例如node.name:${HOSTNAME}
  40. bootstrap.memory_lock
  41. bootstrap.memory_lock: true(遇到问题,见博客园博客)
  42. /etc/sysctl.conf 增加vm.swappiness=0
  43. network.host
  44. 一旦配置标志进入生产环境
  45. discovery.zen.ping.unicast.hosts
  46. 自动入集群
  47. discovery.zen.minimum_master_nodes
  48. 避免脑裂
  49. 生产环境需要设置bootstrap.memory_lock: true
  50. 节点如下配置,承担的角色为负载均衡
  51. node.master: false
  52. node.data: false
  53. node.ingest: false
  54. 配置文件elasticsearch.yml参考:
  55. cluster.name: rokid-test
  56. node.name: node-41
  57. node.master: true
  58. node.data: true
  59. path.data: /home/zhangzhenghai/elk/data/elasticsearch/data
  60. path.logs: /home/zhangzhenghai/elk/data/elasticsearch/logs
  61. bootstrap.memory_lock: true
  62. bootstrap.system_call_filter: false
  63. network.host: test41
  64. http.port: 9200
  65. discovery.zen.ping.unicast.hosts:
  66. - test41
  67. - test42
  68. - test43
  69. discovery.zen.minimum_master_nodes: 2
  70. action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
  71. 启动方式:bin/elasticsearch -d -p pid
  72. 停止方式:kill `cat pid`
  73. 重启方式:kill `cat pid`
  74. bin/elasticsearch -d -p pid
  75. Logstash
  76. 参考https://www.elastic.co/guide/en/logstash/current/index.html
  77. grok正则表达式参考:https://grokdebug.herokuapp.com/
  78. 配置文件:
  79. input {
  80. beats {
  81. port => "5043"
  82. }
  83. }
  84. filter {
  85. grok {
  86. match => {
  87. "message" => "%{HOSTNAME:hostabc} %{DAY:zhouji} %{WORD:month} %{MONTHDAY:jihao} %{TIME:shijian} %{TZ:biaozhun} %{YEAR:nian} %{TIMESTAMP_ISO8601:shijianquan} \[%{WORD:zhonglei}\] %{WORD:caozuo} %{NOTSPACE:info}"
  88. }
  89. }
  90. }
  91. output {
  92. file {
  93. codec => line {format => "%{message}"}
  94. path => "/home/zhangzhenghai/elk/data/logstash/%{hostabc}.log"
  95. }
  96. elasticsearch {
  97. hosts => ["test41:9200","test42:9200","test43:9200"]
  98. index => "%{hostabc}"
  99. document_type => "%{hostabc}"
  100. flush_size => 100
  101. idle_flush_time => 10
  102. user => "elastic"
  103. password => "baoshan"
  104. }
  105. }
  106. 上面的正则表达式对应的原始日志参考:
  107. test-41.dev.rokid-inc.com Tue Apr 25 14:54:36 CST 2017 2017-04-16 23:37:44,282 [DEBUG] add service:com.rokid.open.nlp.facade.NLPService
  108. 启动方式(自动加载配置文件,修改配置文件不用重启Logstash):
  109. bin/logstash -f config/firtst.conf --config.reload.automatic
  110. Kibana
  111. 配置文件参考:
  112. server.port: 5601
  113. server.host: "test43"
  114. elasticsearch.url: "http://test43:9200"
  115. elasticsearch.preserveHost: true
  116. kibana.index: ".kibana"
  117. kibana.defaultAppId: "discover"
  118. elasticsearch.username: "elastic"
  119. elasticsearch.password: "xxx"
  120. 启动方式:
  121. bin/kibana
  122. X-Pack
  123. bin/elasticsearch-plugin install x-pack 或者线下安装方式
  124. bin/elasticsearch-plugin install file:///path/to/file/x-pack-5.3.1.zip
  125. bin/kibana-plugin install file:///path/to/file/x-pack-5.3.1.zip
  126. 查看是否安装成功:
  127. bin/kibana-plugin list
  128. bin/elasticsearch-plugin list
  129. (如是elastic集群,需要将所有节点安装x-pack后重启,默认用户名密码elastic/changeme才生效)
  130. elasticsearch.yml配置如下信息
  131. action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
  132. 卸载x-pack
  133. bin/elasticsearch-plugin remove x-pack
  134. Beats(可直接写入Elasticseatch):
  135. filebeat-5.3.0-linux-x86_64.tar.gz
  136. 配置文件参考:
  137. filebeat.prospectors:
  138. - input_type: log
  139. paths:
  140. - /home/zhangzhenghai/elk/data/filebeat/testdate.log
  141. document_type: typetest42
  142. output.elasticsearch:
  143. hosts: ["test41:9200","test42:9200","test43:9200"]
  144. index: "indextest42"
  145. username: "elastic"
  146. password: "xxx"
  147. output.logstash:
  148. hosts: ["test39:5043"]
  149. 启动方式:
  150. ./filebeat -e -c filebeat.yml -d "publish"
  151.  
  152. 可能短期内将会部署到线上,随着部署的进行,逐步更新完善本文档。
  153. (发现每当需要文档的时候,经常嫌弃写得少;当需要自己写文档的时候,总感觉没得写?OMG

如更新忘记更新此文档,请参考链接:

http://note.youdao.com/noteshare?id=d9b4d5c0f5991c63c5b8ae965722f619

ELK-“线上标准文档”——测试的更多相关文章

  1. day 41 标准文档流 浮动

    一.标准文档流 什么是标准文档流 宏观的将,我们的web页面和ps等设计软件有本质的区别,web 网页的制作,是个“流”,从上而下 ,像 “织毛衣”.而设计软件 ,想往哪里画东西,就去哪里画 标准文档 ...

  2. python 全栈开发,Day48(标准文档流,块级元素和行内元素,浮动,margin的用法,文本属性和字体属性)

    昨日内容回顾 高级选择器: 后代选择 : div p 子代选择器 : div>p 并集选择器: div,p 交集选择器: div.active 属性选择器: [属性~='属性值'] 伪类选择器 ...

  3. {03--CSS布局设置} 盒模型 二 padding bode margin 标准文档流 块级元素和行内元素 浮动 margin的用法 文本属性和字体属性 超链接导航栏 background 定位 z-index

    03--CSS布局设置 本节目录 一 盒模型 二 padding(内边距) 三 boder(边框) 四 简单认识一下margin(外边距) 五 标准文档流 六 块级元素和行内元素 七 浮动 八 mar ...

  4. AVS、MPEG-2、H264标准文档

    联合信源对AVS解码源码和相应的AVS码流.AVS码流太大,可以从http://cosoft.org.cn/projects/avsdec下载.解压avsdec_source.zip后,用VC6编译a ...

  5. 页面标准文档流、浮动层、float属性(转)

    CSS float 浮动属性介绍 float属性:定义元素朝哪个方向浮动. 1.页面标准文档流.浮动层.float属性 1.1 文档流 HTML页面的标准文档流(默认布局)是:从上到下,从左到右,遇块 ...

  6. Unit 6.标准文档流,浮动,清除浮动以及margin塌陷问题

    一. 什么是标准文档流 文本流其实就是文档的读取和输出顺序,也就是我们通常看到的由左到右.由上而下的读取和输出形式,在网页中每个元素都是按照这个顺序进行排序和显示的,而float和position两个 ...

  7. python全栈开发 * 继承性 层叠性 盒模型 标准文档流 * 180809

    ---恢复内容开始--- 一继承性 1.继承: 给父级设置一些属性,子级继承了父级的该属性,这就是我们的css中的继承. 2. 可继承: color . font-*(size). text-*(de ...

  8. css标准文档流

    css标准文档流 所谓的标准文档流指的是网页当中的一个渲染顺序,就如同人类读书一样,从上向下,从左向右.网页的渲染顺序也是如此.而我们使用的标签默认都是存在于标准文档流当中. 标准文档流当中的特性 空 ...

  9. padding(内边框), border(边框), margin, 标准文档流, 块级元素和行内元素, 浮动 ,margin的用法

    盒模型 在CSS中,"box model"这一术语是用来设计和布局时使用,然后在网页中基本上都会显示一些方方正正的盒子.我们称为这种盒子叫盒模型. 盒模型有两种:标准模型和IE模型 ...

随机推荐

  1. 数学图形(2.12)spherical cycloid球面外摆曲线

    查了半天也没搜到其具体的定义,先把脚本代码和截图发下. #http://www.mathcurve.com/courbes3d/cycloidspheric/cycloidspheric.shtml ...

  2. C# 操作Excel大全

    //引用Microsoft.Office.Interop.Excel.dll文件 //添加using using Microsoft.Office.Interop.Excel; using Excel ...

  3. 【转】word排版宏的使用

    原文: https://blog.csdn.net/bruce_shan/article/details/73302756 -------------------------------------- ...

  4. android开发之MediaPlayer+Service MP3播放器

    import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.Lis ...

  5. NCBI SRA数据预处理

    SRA数据的的处理流程大概如下 一.SRA数据下载. NCBI 上存储的数据现在大都存储为SRA格式. 下载以后就是以SRA为后缀名. 这里可以通过三种方式下载SRA格式的数据. 1.通过http方式 ...

  6. TP框架中ajax post请求时提示404

    ajax post请求时提示404错误 TP框架中ajax post请求时提示404 找了半天是 控制器中方法有错误! 下次再遇到去控制器方法中找一步一步找,肯定能找到,我是单词拼错了!

  7. apk签名相关文章

    签名详解:https://stackoverflow.com/questions/4245303/android-sf-file 使用不同的keystore,签名后生成SF文件一模一样正常吗? 正常 ...

  8. Java 的抽象特性:抽象类与接口深度解析

    要点: 抽象类 接口 抽象类与接口的差别 一. 抽象 对于面向对象编程来说,抽象是它的四大特征之中的一个. 在Java中,能够通过两种形式来体现OOP的抽象:接口和抽象类. 接口和抽象类为我们提供了一 ...

  9. mysql max和count、limit优化

    1.max 的优化记得要对max里面的字段使用索引,可以大大加快速度 2.count的优化,count(*)和count(id) 的结果可能是不一样的,因为可能存在null的情况 3.distinct ...

  10. Linux命令-网络命令:write

    write只能给登录用户发送消息,所以先登录两个用户root和wangyunpeng root登录: wangyunpeng登录: who 查看登录用户 root发送信息给wangyunpeng: w ...