Elasticstack官网:https://www.elastic.co
本文档仅限搭建过程参考,使用相关的文档,不在本文档讨论范围之内。
一切依据的核心即是Elasticstack官网。 查看支持的操作系统:
Elasticstack各版本软件支持的系统等:https://www.elastic.co/support/matrix#show_os
必备软件:
Elasticsearch:elasticsearch-5.3.0.tar.gz
Logstash:logstash-5.3.0.tar.gz
Kibana:kibana-5.3.0-linux-x86_64.tar.gz
Beats:filebeat-5.3.0-linux-x86_64.tar.gz
X-pack:x-pack-5.3.0.zip
jdk1.8:jdk-8u121-linux-i586.tar
搭建流程:
Elasticsearch:
https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
修改时区(如必要):
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
安装JDK1.8,先安装yum install -y glibc.i686
root权限下
sysctl -w vm.max_map_count=262144
/etc/security/limits.conf 增加
* soft nproc 2048 (第一列为Linux账户名)
* hard nproc 4096(第一列为Linux账户)
* soft nofile 65536
* hard nofile 131072
/etc/security/limits.d/90-nproc.conf 修改
* soft nproc 2048
sudo sysctl -p
生产环境需要的配置
Elasticsearch通过name判断所属的集群
● path.data and path.logs
○ 不要和安装目录放一起,防止升级的时候数据丢失
○ 可以配置多个目录
● cluster.name
○ 各节点通过cluster.name加入集群
● node.name
○ 保证重启机器名称不变
○ 可以设置成机器名例如node.name:${HOSTNAME}
● bootstrap.memory_lock
○ bootstrap.memory_lock: true(遇到问题,见博客园博客)
○ /etc/sysctl.conf 增加vm.swappiness=0
● network.host
○ 一旦配置标志进入生产环境
● discovery.zen.ping.unicast.hosts
○ 自动入集群
● discovery.zen.minimum_master_nodes
○ 避免脑裂
生产环境需要设置bootstrap.memory_lock: true
节点如下配置,承担的角色为负载均衡
node.master: false
node.data: false
node.ingest: false
配置文件elasticsearch.yml参考:
cluster.name: rokid-test
node.name: node-41
node.master: true
node.data: true
path.data: /home/zhangzhenghai/elk/data/elasticsearch/data
path.logs: /home/zhangzhenghai/elk/data/elasticsearch/logs
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
network.host: test41
http.port: 9200
discovery.zen.ping.unicast.hosts:
- test41
- test42
- test43
discovery.zen.minimum_master_nodes: 2
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
启动方式:bin/elasticsearch -d -p pid
停止方式:kill `cat pid`
重启方式:kill `cat pid`
bin/elasticsearch -d -p pid
Logstash:
参考https://www.elastic.co/guide/en/logstash/current/index.html
grok正则表达式参考:https://grokdebug.herokuapp.com/
配置文件:
input {
beats {
port => "5043"
}
}
filter {
grok {
match => {
"message" => "%{HOSTNAME:hostabc} %{DAY:zhouji} %{WORD:month} %{MONTHDAY:jihao} %{TIME:shijian} %{TZ:biaozhun} %{YEAR:nian} %{TIMESTAMP_ISO8601:shijianquan} \[%{WORD:zhonglei}\] %{WORD:caozuo} %{NOTSPACE:info}"
}
}
}
output {
file {
codec => line {format => "%{message}"}
path => "/home/zhangzhenghai/elk/data/logstash/%{hostabc}.log"
}
elasticsearch {
hosts => ["test41:9200","test42:9200","test43:9200"]
index => "%{hostabc}"
document_type => "%{hostabc}"
flush_size => 100
idle_flush_time => 10
user => "elastic"
password => "baoshan"
}
}
上面的正则表达式对应的原始日志参考:
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
启动方式(自动加载配置文件,修改配置文件不用重启Logstash):
bin/logstash -f config/firtst.conf --config.reload.automatic
Kibana:
配置文件参考:
server.port: 5601
server.host: "test43"
elasticsearch.url: "http://test43:9200"
elasticsearch.preserveHost: true
kibana.index: ".kibana"
kibana.defaultAppId: "discover"
elasticsearch.username: "elastic"
elasticsearch.password: "xxx"
启动方式:
bin/kibana
X-Pack
bin/elasticsearch-plugin install x-pack 或者线下安装方式
bin/elasticsearch-plugin install file:///path/to/file/x-pack-5.3.1.zip
bin/kibana-plugin install file:///path/to/file/x-pack-5.3.1.zip
查看是否安装成功:
bin/kibana-plugin list
bin/elasticsearch-plugin list
(如是elastic集群,需要将所有节点安装x-pack后重启,默认用户名密码elastic/changeme才生效)
elasticsearch.yml配置如下信息
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
卸载x-pack
bin/elasticsearch-plugin remove x-pack
Beats(可直接写入Elasticseatch):
filebeat-5.3.0-linux-x86_64.tar.gz
配置文件参考:
filebeat.prospectors:
- input_type: log
paths:
- /home/zhangzhenghai/elk/data/filebeat/testdate.log
document_type: typetest42
output.elasticsearch:
hosts: ["test41:9200","test42:9200","test43:9200"]
index: "indextest42"
username: "elastic"
password: "xxx"
output.logstash:
hosts: ["test39:5043"]
启动方式:
./filebeat -e -c filebeat.yml -d "publish" 可能短期内将会部署到线上,随着部署的进行,逐步更新完善本文档。
(发现每当需要文档的时候,经常嫌弃写得少;当需要自己写文档的时候,总感觉没得写?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. linux有用技巧:使用ntfs-3g挂载ntfs设备

    1.几种文件系统的比較 (1)在linux系统中支持一下文件系统:               Ext2         第二扩展文件系统(简称 ext2 或者 ext2) 非常多年前就已经成为 GN ...

  2. iOS: 删除真机测试的Provisioning Profile后,在Code Singing中出现entitlements.plist文件无效,解决办法如下:

    问题主题:method to The entitlements specified in your application’s Code Signing Entitlements file do no ...

  3. SpringMVC的学习

    在看<跟开涛学SpringMVC.pdf> /Users/baidu/Documents/Data/Interview/Java Spring Web MVC 也是服务到工作者模式的实现, ...

  4. C#使用DirectShow播放视频文件 [转]

    原文网址:http://blog.csdn.net/openzpc/article/details/48442751 最近在开发一个视频播放软件,主要要求就是循环播放多个视频文件,并且要求两个视频文件 ...

  5. 度量Web性能的关键指标

    自网站诞生以来,响应速度/响应时间一直都是大家关心的话题,而速度慢乃是网站的一个杀手,正当大家以为四核和宽带能力的提升能够解决这些问题时,Wi-Fi和移动设备为热点移动互联网又悄然兴起. 在2006年 ...

  6. IOS 预处理语句

    程序中的源代码计算机是无法识别的,需要将写好的代码转成0.1二进制代码,计算机才能识别.将源代码转成二进制代码的需要经过两步,编译和链接.编译是通过编译器将每个文件的代码都转为二进制代码,在这个过程中 ...

  7. 零基础学python-3.5 内存管理

    * 变量无需事先声明 * 变量无需指定类型 * 程序猿不用关系内存管理 * 变量名会被回收 * del能够直接释放资源 1.python使用的是引用调用,而不是值调用,他使用的回收算法是引用计数算法, ...

  8. (笔试题)质数因子Prime Factor

    题目: Given any positive integer N, you are supposed to find all of its prime factors, and write them ...

  9. 算法笔记_148:有向图欧拉回路求解(Java)

    目录 1 问题描述 2 解决方案   1 问题描述 Description A catenym is a pair of words separated by a period such that t ...

  10. excel 快速比对两列数据差异

      excel 快速比对两列数据差异 CreateTime--2018年5月31日11:19:35 Author:Marydon 1.情景展示 找出两列数据的差异 2.具体操作 方式一:使用条件格式 ...