玩转 EFK 之小试牛刀

原创文章,转载请注明出处,违者必追究其法律责任。

本文只是最初级的安装,不涉及任何安全策略和高级应用,后续会添加关于最后优化部分的详细配置以及生产级的日志配置。

环境

Elastic公司官网下载安装包,安装遇到问题以及配置详情参考官网文档,:

# 安装包准备
elasticsearch-6.5.4.tar.gz                # Elasticsearch
filebeat-6.5.4-linux-x86_64.tar.gz        # Filebeat
kibana-6.5.4-linux-x86_64.tar.gz          # Kibana
logstash-6.5.4.tar.gz                     # Logstash

jdk-8u191-linux-x64.tar.gz                # ES、Losstash、Kibana依赖
kafka_2.11-2.0.0.tgz                      # kafka
zookeeper-3.4.13.tar.gz                   # kafka依赖注册中心

# 服务器列表
192.168.0.188  CentOS7.5   4C    8G    
192.168.0.189  CentOS7.5   4C    4G
192.168.0.191  CentOS7.5   4C    4G

Elasticsearch

用户

groupadd es          # 添加用户组
useradd -g es es     # 添加用户到指定用户组
passwd es            # 为指定用户设置密码

解压

tar zxvf elasticsearch-2.3.4.tar.gz -C /opt

授权

# 把文件夹赋予给es用户
[root@vm-centos75-0188 opt]# chown -R es:es /opt/elasticsearch-6.5.4
[root@vm-centos75-0188 opt]# chown -R es:es /opt/data/es
# 把文件夹设置所有用户可读写
[root@vm-centos75-0188 opt]# chown -R 777 /opt/data

配置

vim /opt/elasticsearch-6.5.4/config/elasticsearch.yml

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: cosmo-efk
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: cosmo-node-188
#
# Add custom attributes to the node:
#
node.attr.rack: r1
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /opt/data/es/data
#
# Path to log files:
#
path.logs: /opt/data/es/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.0.188
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["192.168.0.188", "192.168.0.189", "192.168.0.190"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes:
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

另外启动遇到了几个错误,需要修改如下文件:

# ERROR: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
vi /etc/security/limits.conf 

# 添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096


# ERROR:max number of threads [2048] for user [lish] likely too low, increase to at least [4096]
vi /etc/security/limits.d/90-nproc.conf 

# 修改如下内容:
* soft nproc 1024

# 修改为
* soft nproc 4096


# ERROR:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

vi /etc/sysctl.conf 
# 添加下面配置:
vm.max_map_count=655360

# 并执行命令:
sysctl -p

运行

# 安装Java环境(一般服务器自带openjdk需先卸载,openjdk和oracle jdk有何区别自行百度)
[root@vm-centos75-0188 packages]# /opt/elasticsearch-6.5.4/bin/elasticsearch
which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
could not find java; set JAVA_HOME or ensure java is in PATH

[root@vm-centos75-0188 packages]# java -version
-bash: java: 未找到命令

# 查看JDK版本
[root@vm-centos75-0188 packages]# java -version
-bash: java: 未找到命令

# 查看包含java字符串的文件,其中删除类似下面这四个文件(不一定是四个)
[root@vm-centos75-0188 packages]# rpm -qa | grep java
java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64

# 包含noarch的文件不必删除,如下:
python-javapackages-3.4.1-11.el7.noarch
tzdata-java-2016g-2.el7.noarch
javapackages-tools-3.4.1-11.el7.noarch

# 查询出来带openjdk的全部使用下面的命令卸载
[root@vm-centos75-0188 packages]# yum -y remove java java-x.x.x-gcj-compat-x.x.x.x-xxjpp.xxx
[root@vm-centos75-0188 packages]# yum -y remove java java-x.x.x-openjdk-x.x.x.x-x.x.bxx.exx

# 文件最后添加如下内容
[root@vm-centos75-0188 opt]# vi /etc/profile
export JAVA_HOME=/opt/jdk1.8.0_191
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

# 生效环境变量
[root@vm-centos75-0188 opt]# source /etc/profile

# 检查是否配置成功
[root@vm-centos75-0188 opt]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

# 切换到es用户然后运行下面的命令
# 直接运行会打印log日志在控制台,关闭服务即刻关闭
$ /opt/elasticsearch-6.5.4/bin/elasticsearch
# 加-d参数后台启动
$ /opt/elasticsearch-6.5.4/bin/elasticsearch -d

访问

http://192.168.0.188:9200/返回如下内容表示安装成功

{
  "name" : "cosmo-node-188",
  "cluster_name" : "cosmo-efk",
  "cluster_uuid" : "UgyoS_kMQjKJCxsVUmh-Rw",
  "version" : {
    "number" : "6.5.4",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "d2ef93d",
    "build_date" : "2018-12-17T21:17:40.758843Z",
    "build_snapshot" : false,
    "lucene_version" : "7.5.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Kibana

解压

[root@vm-centos75-0189 opt]# tar zxvf kibana-6.5.4-linux-x86_64.tar.gz -C /opt
[root@vm-centos75-0189 opt]# mv /opt/kibana-6.5.4-linux-x86_64 /opt/kibana

配置

[root@vm-centos75-0189 opt]# vi kibana/config/kibana.yml 
# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.0.189"

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

# Specifies whether Kibana should rewrite requests that are prefixed with
# `server.basePath` or require that they are rewritten by your reverse proxy.
# This setting was effectively always `false` before Kibana 6.3 and will
# default to `true` starting in Kibana 7.0.
#server.rewriteBasePath: false

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name.  This is used for display purposes.
server.name: "cosmo-kibana-189"

# The URL of the Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://192.168.0.188:9200"

启动

# 直接启动
$ /opt/kibana/bin/kibana
# 后台启动
$ /opt/kibana/bin/kibana -d
# 浏览器访问下面地址
http://192.168.0.189:5601

Kafka

生产环境中 Kafka 集群中节点数量建议为(2N + 1 )个,这边就以 3 个节点举例

解压

tar -zxvf kafka_2.11-1.0.0.tgz
mv kafka_2.11-1.0.0 kafka
tar -zxvf zookeeper-3.4.13.tar.gz -C /opt
mv zookeeper-3.4.13 zookeeper

配置Zookeeper 集群

修改 Zookeeper 配置,搭建 Zookeeper 集群,数量 ( 2N + 1 ) 个,复制下面的配置文件到另外2台服务器

$ cd /opt/zookeeper/conf && cp zoo_sample.cfg zoo.cfg && vi zoo.cfg
$ cat zoo.cfg

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/opt/data/zookeeper/data
dataLogDir=/opt/data/zookeeper/logs
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.0.188:2888:3888
server.2=192.168.0.189:2888:3888
server.3=192.168.0.191:2888:3888

Zookeeper data 目录下面添加 myid 文件,内容为代表 Zooekeeper 节点 id (1,2,3),并保证不重复

$ echo "1" > /opt/data/zookeeper/data/myid         # 192.168.0.188
$ echo "2" > /opt/data/zookeeper/data/myid         # 192.168.0.189
$ echo "3" > /opt/data/zookeeper/data/myid         # 192.168.0.191

启动 Zookeeper 集群

分别启动 3 台 Zookeeper 节点,保证集群的高可用

$ ./zkServer.sh -start        # 启动
$ ./zkServer.sh -stop         # 停止
$ ./zkServer.sh -status       # 状态

配置 Kafka 集群

kafka 集群这边搭建为 3 台,可以逐个修改 Kafka 配置,需要注意其中 broker.id 分别 (1,2,3)

$ vi /opt/kafka/config/server.properties
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# see kafka.server.KafkaConfig for additional details and defaults

############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=188

############################# Socket Server Settings #############################

# The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://192.168.0.188:9092

# Hostname and port the broker will advertise to producers and consumers. If not set, 
# it uses the value for "listeners" if configured.  Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
advertised.listeners=PLAINTEXT://192.168.0.188:9092

# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL

# The number of threads that the server uses for receiving requests from the network and sending responses to the network
num.network.threads=8

# The number of threads that the server uses for processing requests, which may include disk I/O
num.io.threads=8

# The send buffer (SO_SNDBUF) used by the socket server
socket.send.buffer.bytes=102400

# The receive buffer (SO_RCVBUF) used by the socket server
socket.receive.buffer.bytes=102400

# The maximum size of a request that the socket server will accept (protection against OOM)
socket.request.max.bytes=104857600


############################# Log Basics #############################

# A comma separated list of directories under which to store log files
log.dirs=/opt/data/kafka/logs

# The default number of log partitions per topic. More partitions allow greater
# parallelism for consumption, but this will also result in more files across
# the brokers.
num.partitions=3

# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
# This value is recommended to be increased for installations with data dirs located in RAID array.
num.recovery.threads.per.data.dir=1

############################# Internal Topic Settings  #############################
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
# For anything other than development testing, a value greater than 1 is recommended for to ensure availability such as 3.
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1

############################# Log Flush Policy #############################

# Messages are immediately written to the filesystem but by default we only fsync() to sync
# the OS cache lazily. The following configurations control the flush of data to disk.
# There are a few important trade-offs here:
#    1. Durability: Unflushed data may be lost if you are not using replication.
#    2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
#    3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks.
# The settings below allow one to configure the flush policy to flush data after a period of time or
# every N messages (or both). This can be done globally and overridden on a per-topic basis.

# The number of messages to accept before forcing a flush of data to disk
#log.flush.interval.messages=10000

# The maximum amount of time a message can sit in a log before we force a flush
#log.flush.interval.ms=1000

############################# Log Retention Policy #############################

# The following configurations control the disposal of log segments. The policy can
# be set to delete segments after a period of time, or after a given size has accumulated.
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
# from the end of the log.

# The minimum age of a log file to be eligible for deletion due to age
log.retention.hours=168

# A size-based retention policy for logs. Segments are pruned from the log unless the remaining
# segments drop below log.retention.bytes. Functions independently of log.retention.hours.
#log.retention.bytes=1073741824

# The maximum size of a log segment file. When this size is reached a new log segment will be created.
log.segment.bytes=1073741824

# The interval at which log segments are checked to see if they can be deleted according
# to the retention policies
log.retention.check.interval.ms=300000

############################# Zookeeper #############################

# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.connect=192.168.0.188:2181,192.168.0.189:2181,192.168.0.191:2181

# Timeout in ms for connecting to zookeeper
zookeeper.connection.timeout.ms=6000

############################# Group Coordinator Settings #############################

# The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance.
# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms.
# The default value for this is 3 seconds.
# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing.
# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup.
group.initial.rebalance.delay.ms=0

启动 Kafka 集群

分别启动 3 台 Kafka 节点,保证集群的高可用

# 启动
$ /opt/kafka/bin/kafka-server-start.sh -daemon /opt/kafka/config/server.properties
# 查看 topic 是否创建成功
$ /opt/kafka/bin/kafka-topics.sh --list --zookeeper 192.168.0.188:2181

Logstash

解压

[root@vm-centos75-0191 opt]# tar zxvf logstash-6.5.4.tar.gz -C /opt
[root@vm-centos75-0191 opt]# mv /opt/logstash-6.5.4 /opt/logstash

配置

[root@vm-centos75-0191 config]# cd /opt/logstash/config
[root@vm-centos75-0191 config]# cp logstash-sample.conf logstash.conf
[root@vm-centos75-0191 config]# vi logstash.conf 
[root@vm-centos75-0191 config]# cat logstash.conf 
input {
  kafka {
    bootstrap_servers => "192.168.0.188:9092"
    topics => "idp-bpm"
    #topics_pattern => "^idp\\-.*"
  }
}

output {
  elasticsearch {
    hosts => ["http://192.168.0.188:9200"]
    index => "idp-%{+YYYY.MM.dd}"
    #user => "elastic"
    #password => "changeme"
  }
}

启动

# 直接启动
[root@vm-centos75-0191 bin]# ./logstash -f ../config/logstash.conf
# 后台启动
[root@vm-centos75-0191 bin]# cd /opt/logstash/
[root@vm-centos75-0191 logstash]# nohup bin/logstash -f config/logstash.conf --config.reload.automatic >& /opt/data/logstash/logs/logstash &

FileBeat

解压

[root@vm-centos75-0191 opt]# tar zxvf filebeat-6.5.4-linux-x86_64.tar.gz -C /opt
[root@vm-centos75-0191 opt]# mv /opt/filebeat-6.5.4-linux-x86_64 /opt/filebeat

配置

vi /opt/filebeat/filebeat.yml

###################### Filebeat Configuration Example #########################

# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

#=========================== Filebeat inputs =============================

filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.

- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    #- /var/log/*.log
    - E:\idp\logs\bpm\bpm.log

  # Exclude lines. A list of regular expressions to match. It drops the lines that are
  # matching any regular expression from the list.
  #exclude_lines: ['^DBG']

  # Include lines. A list of regular expressions to match. It exports the lines that are
  # matching any regular expression from the list.
  #include_lines: ['^ERR', '^WARN']

  # Exclude files. A list of regular expressions to match. Filebeat drops the files that
  # are matching any regular expression from the list. By default, no files are dropped.
  #exclude_files: ['.gz$']

  # Optional additional fields. These fields can be freely picked
  # to add additional information to the crawled log files for filtering
  #fields:
  #  level: debug
  #  review: 1

  ### Multiline options

  # Multiline can be used for log messages spanning multiple lines. This is common
  # for Java Stack Traces or C-Line Continuation

  # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
  #multiline.pattern: ^\[

  # Defines if the pattern set under pattern should be negated or not. Default is false.
  #multiline.negate: false

  # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
  # that was (not) matched before or after or as long as a pattern is not matched based on negate.
  # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
  #multiline.match: after


#============================= Filebeat modules ===============================

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

  # Period on which files under path should be checked for changes
  #reload.period: 10s

#==================== Elasticsearch template setting ==========================

setup.template.settings:
  index.number_of_shards: 3
  #index.codec: best_compression
  #_source.enabled: false

#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging


#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here, or by using the `-setup` CLI flag or the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:

#============================= Elastic Cloud ==================================

# These settings simplify using filebeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.


#------------------------------ Kafka output ----------------------------------
output.kafka:   
  hosts: ["192.168.0.188:9092"]
  topic: idp-bpm
  required_acks: 1

#-------------------------- Elasticsearch output ------------------------------
#output.elasticsearch:
  # Array of hosts to connect to.
  #hosts: ["localhost:9200"]

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  #username: "elastic"
  #password: "changeme"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

#================================ Procesors =====================================

# Configure processors to enhance or manipulate events generated by the beat.

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

#============================== Xpack Monitoring ===============================
# filebeat can export internal metrics to a central Elasticsearch monitoring
# cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#xpack.monitoring.enabled: false

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well. Any setting that is not set is
# automatically inherited from the Elasticsearch output configuration, so if you
# have the Elasticsearch output configured, you can simply uncomment the
# following line.
#xpack.monitoring.elasticsearch:

启动

Windows 设置为服务启动

Linux 设置为服务启动

优化

  • 所有组件作为服务启动
  • 所有组件集群一键启动、停止、查看状态
  • 所有组件监控插件、第三方程序的研究
  • 所有组件一键安装配置的研究
  • 所有组件安全设置的研究
  • 所有组件高级设置的研究
  • Logstash 输入、输出、过滤以及消费kafka topic正则表达式设置的研究
  • Kibana 图表、仪表、各项目指标归纳设置的研究
  • 用户足迹、业务日志、系统日志分类等归纳设置的研究