0.拓扑图

参考:https://www.cnblogs.com/JetpropelledSnake/p/10057545.html

官网: http://kafka.apache.org/documentation.html#introduction  kafka原理

https://www.cnblogs.com/jixp/articles/9435699.html    Kafka全解析  https://blog.csdn.net/vinfly_li/article/details/79397201

1.logstash的配置

[root@VM_0_4_centos config]# cat wxqyh.yml|egrep -v '^$|^#'
input {
file {
type => "4personal20001"
path => "/mnt/data/logs/personal_20001/log4j.log"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => "previous"
}
}
file {
type => "4personal20002"
path => "/mnt/data/logs/personal_20002/log4j.log"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => "previous"
}
}
}
filter { grok {
match => {
"message" => "^%{TIMESTAMP_ISO8601}\[%{WORD:level} %{GREEDYDATA:ajpcon}\| %{GREEDYDATA:data}"
}
match => {
"message" => "^%{TIMESTAMP_ISO8601}\[ %{WORD:level} %{GREEDYDATA:ajpcon}\| %{GREEDYDATA:data}"
}
remove_field => "message"
}
}
output {
if [type] == "4personal20001" {
kafka {
max_request_size => 10485761
bootstrap_servers => "10.0.0.134:9092"
topic_id => "topic4personal1"
compression_type => "snappy"
}
}
if [type] == "4personal20002" {
kafka {
max_request_size => 10485761
bootstrap_servers => "10.0.0.134:9092"
topic_id => "topic4personal2"
compression_type => "snappy"
}
}
}

2.kafka的配置

[root@VM_0_134_centos config]# cat server.properties|egrep -v '^$|^#'
broker.id=
listeners=PLAINTEXT://10.0.0.134:9092
advertised.listeners=PLAINTEXT://10.0.0.134:9092
num.network.threads=
num.io.threads=
socket.send.buffer.bytes=
socket.receive.buffer.bytes=
socket.request.max.bytes=
message.max.bytes=
replica.fetch.max.bytes=
log.dirs=/mnt/data/monitor01/kafka_2.-1.1./data
num.partitions=
num.recovery.threads.per.data.dir=
offsets.topic.replication.factor=
transaction.state.log.replication.factor=
transaction.state.log.min.isr=
log.retention.hours=
log.segment.bytes=
log.retention.check.interval.ms=
zookeeper.connect=localhost:
zookeeper.connection.timeout.ms=
group.initial.rebalance.delay.ms=

3.logstash2的配置

[root@VM_0_134_centos config]# cat haode.yml|egrep -v '^$|^#'
input {
kafka {
type => "topic12wxqyh8"
codec => "plain"
topics => ["topic12wxqyh8"]
client_id => "es1"
group_id => "es1"
bootstrap_servers => "10.0.0.134:9092"
} kafka {
type => "topic12wxqyh9"
codec => "plain"
topics => ["topic12wxqyh9"]
client_id => "es2"
group_id => "es2"
bootstrap_servers => "10.0.0.134:9092"
}
kafka {
type => "topic24wxqyh6"
codec => "plain"
topics => ["topic24wxqyh6"]
client_id => "es3"
group_id => "es3"
bootstrap_servers => "10.0.0.134:9092"
} kafka {
type => "topic24wxqyh7"
codec => "plain"
topics => ["topic24wxqyh7"]
client_id => "es4"
group_id => "es4"
bootstrap_servers => "10.0.0.134:9092"
} kafka {
type => "topic4personal1"
codec => "plain"
topics => ["topic4personal1"]
client_id => "es5"
group_id => "es5"
bootstrap_servers => "10.0.0.134:9092"
}
kafka {
type => "topic4personal2"
codec => "plain"
topics => ["topic4personal2"]
client_id => "es6"
group_id => "es6"
bootstrap_servers => "10.0.0.134:9092"
} } output {
if [type] == "topic12wxqyh8" {
elasticsearch {
index => "topic12wxqyh8"
hosts => ["10.0.0.7:9200"]
}
} if [type] == "topic12wxqyh9" {
elasticsearch {
index => "topic12wxqyh9"
hosts => ["10.0.0.7:9200"]
}
}
if [type] == "topic24wxqyh6" {
elasticsearch {
index => "topic24wxqyh6"
hosts => ["10.0.0.7:9200"]
}
}
if [type] == "topic24wxqyh7" {
elasticsearch {
index => "topic24wxqyh7"
hosts => ["10.0.0.7:9200"]
}
}
if [type] == "topic4personal1" {
elasticsearch {
index => "topic4personal1"
hosts => ["10.0.0.7:9200"]
}
}
if [type] == "topic4personal2" {
elasticsearch {
index => "topic4personal2"
hosts => ["10.0.0.7:9200"]
}
}
}

参考:https://www.cnblogs.com/swordfall/p/8860941.html#auto_id_4

4.kafka的问题:

4.1zookeeper--选主,提供访问入口

4.2 Kafka的原理

生产者将数据发送到Broker代理,Broker代理有多个话题topic,消费者从Broker获取数据。

参考: https://zhuanlan.zhihu.com/p/97030680

5.partion--相当于es的shard

logstash1 - kafka - logstash2 - elasticsearch - kibana的更多相关文章

  1. Filebeat+Kafka+Logstash+ElasticSearch+Kibana搭建完整版

    1. 了解各个组件的作用 Filebeat是一个日志文件托运工具,在你的服务器上安装客户端后,filebeat会监控日志目录或者指定的日志文件,追踪读取这些文件(追踪文件的变化,不停的读) Kafka ...

  2. Filebeat+Kafka+Logstash+ElasticSearch+Kibana 日志采集方案

    前言 Elastic Stack 提供 Beats 和 Logstash 套件来采集任何来源.任何格式的数据.其实Beats 和 Logstash的功能差不多,都能够与 Elasticsearch 产 ...

  3. lagstash + elasticsearch + kibana 3 + kafka 日志管理系统部署 02

    因公司数据安全和分析的需要,故调研了一下 GlusterFS + lagstash + elasticsearch + kibana 3 + redis 整合在一起的日志管理应用: 安装,配置过程,使 ...

  4. Flink SQL结合Kafka、Elasticsearch、Kibana实时分析电商用户行为

    body { margin: 0 auto; font: 13px / 1 Helvetica, Arial, sans-serif; color: rgba(68, 68, 68, 1); padd ...

  5. 安装logstash,elasticsearch,kibana三件套

    logstash,elasticsearch,kibana三件套 elk是指logstash,elasticsearch,kibana三件套,这三件套可以组成日志分析和监控工具 注意: 关于安装文档, ...

  6. 使用logstash+elasticsearch+kibana快速搭建日志平台

    日志的分析和监控在系统开发中占非常重要的地位,系统越复杂,日志的分析和监控就越重要,常见的需求有: * 根据关键字查询日志详情 * 监控系统的运行状况 * 统计分析,比如接口的调用次数.执行时间.成功 ...

  7. 安装logstash,elasticsearch,kibana三件套(转)

    logstash,elasticsearch,kibana三件套 elk是指logstash,elasticsearch,kibana三件套,这三件套可以组成日志分析和监控工具 注意: 关于安装文档, ...

  8. logstash+elasticsearch+kibana快速搭建日志平台

    使用logstash+elasticsearch+kibana快速搭建日志平台   日志的分析和监控在系统开发中占非常重要的地位,系统越复杂,日志的分析和监控就越重要,常见的需求有: 根据关键字查询日 ...

  9. 快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana)

    快速搭建应用服务日志收集系统(Filebeat + ElasticSearch + kibana) 概要说明 需求场景,系统环境是CentOS,多个应用部署在多台服务器上,平时查看应用日志及排查问题十 ...

随机推荐

  1. 7、Spring Boot 2.x 集成 Redis

    1.7 Spring Boot 2.x 集成 Redis 简介 继续上篇的MyBatis操作,详细介绍在Spring Boot中使用RedisCacheManager作为缓存管理器,集成业务于一体. ...

  2. Educational Codeforces Round 37 (Rated for Div. 2) 920E E. Connected Components?

    题 OvO http://codeforces.com/contest/920/problem/E 解 模拟一遍…… 1.首先把所有数放到一个集合 s 中,并创建一个队列 que 2.然后每次随便取一 ...

  3. tinymce+粘贴word图片例子

    tinymce是很优秀的一款富文本编辑器,可以去官网下载.https://www.tiny.cloud 这里分享的是它官网的一个收费插件powerpaste的旧版本源码,但也不影响功能使用. http ...

  4. Java+自动扫描文件夹+发送+上传

    1.介绍enctype enctype 属性规定发送到服务器之前应该如何对表单数据进行编码. enctype作用是告知服务器请求正文的MIME类型(请求消息头content-type的作用一样) 1. ...

  5. 配置apt源

    vim /etc/apt/source.list 配置完成后执行 apt update apt upgrade 配置完源之后,就可以在源中所有想要的包 apt search xxx 本地自带的源配目录 ...

  6. 2018 Nowcoder Multi-University Training Contest 1

    Practice Link J. Different Integers 题意: 给出\(n\)个数,每次询问\((l_i, r_i)\),表示\(a_1, \cdots, a_i, a_j, \cdo ...

  7. GAN生成式对抗网络(二)——tensorflow代码示例

    代码实现 当初学习时,主要学习的这个博客 https://xyang35.github.io/2017/08/22/GAN-1/ ,写的挺好的. 本文目的,用GAN实现最简单的例子,帮助认识GAN算法 ...

  8. windows中命令行窗口提权到管理员权限.windows 的 sudo

    命令行环境中获取管理员权限 第一种方法 (最爽,但是被运行的命令会被当成新进程运行,运行完成后就自动关闭了.) 把以下代码复制到记事本中保存为sudo.vbs 然后移动到PATH任意目录中,如wind ...

  9. 将String类型的字符串拼接成以逗号分隔的字符输出

    package test; import java.util.ArrayList; import java.util.List; public class Tesdssss { private sta ...

  10. @Transactional注解不生效的原因总结(整理网上和自己遇到的解决方案)

    1.问题背景 今天做项目,发现配置好@Transactional后,没有生效,事务没有回滚,即便在网上查资料,也没有解决,好像网上没有人发过我遇见的这种情况的帖子. 2.自己遇到的情况分析 代码结构图 ...