Kibana7.x ELK log analysis system of the latest version of the Installation and Configuration

3, Kibana profile

Kibana allows you the freedom to choose how to present their own data. Kibana core product is equipped with a number of classic features: bar charts, line graphs, pie charts, map, and so the sun.

3.1 Package Download: https: //www.elastic.co/cn/downloads/kibana

3.1.1 package tar archive, extract it to / application directory and create a link file.

ln -s /application/kibana-7.3.2-linux-x86_64 /application/kibana

3.2, configuration Kibana service profile /application/kibana/config/kibana.yml

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601   #kibana端口

# 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: "10.0.0.169"    #绑定的主机IP地址

# 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: "your-hostname"

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://10.0.0.169:9200"]      #elasticsearch的主机IP

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
kibana.index: ".kibana"     #开启此选项

# The default application to load.
#kibana.defaultAppId: "home"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
#elasticsearch.username: "kibana"
#elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#server.ssl.enabled: false
#server.ssl.certificate: /path/to/your/server.crt
#server.ssl.key: /path/to/your/server.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files validate that your Elasticsearch backend uses the same key files.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
#elasticsearch.ssl.certificateAuthorities: [ "/path/to/your/CA.pem" ]

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#elasticsearch.ssl.verificationMode: full

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-side
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid

# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
ops.interval #: 5000 

# Specifies locale to BE Used for All the Localizable strings, and a dates Number The Formats. 
# at The following are Supported languages: English - EN, by default , Chinese - en-US CN. 
 i18n.locale: "zh-CN "#kibana default text is in English, changed into Chinese

3.3, start kibana

If you use the root user to start the service, the latter must be added --allow-root option.

[root@harlan_ansible ~]# /application/kibana/bin/kibana --allow-root

3.4, accessed through the browser address: http: //10.0.0.169: 5601

 

From the above, kibana services to install and configure successfully.

3.5 By accessing kibana browser, we may need to collect directly on the host installation log Beats software, no installation Logstash package.

Beats by configuring the service configuration file to collect logs of different services.

3.5.1 Example collection of native file system log

1

Download and install Filebeat

curl -L -O https: // artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.3.2-x86_64.rpm 
sudo rpm -You filebeat- 7.3 . 2 -x86_64.rpm
 
Step  2

Edit Configuration

Modified  /etc/filebeat/filebeat.yml to set the connection information:

output.elasticsearch:
  hosts: ["<es_url>"]
  username: "elastic"
  password: "<password>"
setup.kibana:
  host: "<kibana_url>" 

Among them, <password> is the  elastic user's password, <es_url> is Elasticsearch the URL, <kibana_url> is the URL Kibana.

Step  3

Enable and configure the system module

sudo filebeat modules enable system

In  /etc/filebeat/modules.d/system.yml modify the settings file.

 
Step  4

Start Filebeat

setup Command to load Kibana dashboard. If the instrument panel has been set, omit this command.

sudo filebeat setup
sudo service filebeat start
 
Unfinished steps 

Module status

Confirmation from Filebeat  system module successfully received data 


After completing all the steps, you can view your data at any time.

 3.6, in kibana service, according to different collecting logs rpm package installed on different hosts. Specific details are as follows:

 

 

Guess you like

Origin www.cnblogs.com/eeexu123/p/11608669.html