ELK部署实战

                        ELK部署实战

                                      作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

  

  简单的来说ELK是日志收集,存储,可视化的一套组件。如果你看过我之前分享关于大数据生态圈的Flume组件。Flume也是一款日志收集工具,它处理的是非铭感日志数据,换句话说,大数据日志收集工具Flume一般处理不重要的数据,当然你也可以说是处理价值密度低的数据。

一.ELK包含的组件

1>.Elasticsearch

    存储所有的日志,建立索引,搜索的功能

    1.1>.易于部署,
    1.2>.竖直和水平可进行伸缩。
    1.3>.API易于使用
    1.4>.多与大多数编程/脚本语言都可以模块化(支持Python API进行查询,大量的查询和过滤选项都可以使用json语句。 灵活可控。)。
    1.5>.友好的在线文档
    1.6>.免费。

2>.Logstash

    类似于flume(只不过flume一般和Kafka结合使用,而logstash主要是和Elasticsearch结合使用),收集日志的。它的数据源包括:

    2.1>.Windows Event Logs

    2.2>.Syslog

    2.3>.Bro(session data/dpi)

    2.4>.SiLK(flow)

    2.5>.SNMP

    2.6>.PCAP(stored on disk,index information in ES)

3>.Kibana

  它是一个可视化工具(类似于R语言),即它是一个webUI的接口,它可以通过nginx服务端进行代理,其特点如下:

  3.1>.批量分析
  3.2>.数据集关联
  3.3>.生成图标进行显示
  3.4>.报警

4>.Filebeat

  一般用作日志代理,通过网络协议传输logstash。类似于Flume的spooldir组件(提取文件的内容),因此filebeat一般安装在客户端服务器上。大致拓扑如下图所示:

5>.ELK关系

   上图可以简单的描述为:Logstash(collect功能,相当于Flume) ---> Elasticsearch(storage + index + search,相当于Kafka) ---> kibana (view提供友好的web界面,类似于R语言)。

 6>.集群部署环境

  本篇博客采用的CentOS官网的“CentOS Linux release 7.2.1511 (Core) ”linux发行版,具体配置信息如下:

  如果你是CentOS Linux release 6.x系列可以参考我之前的笔记:https://www.cnblogs.com/yinzhengjie/p/7745743.html

二.安装Elasticsearch

  关于ELK的所有安装包我已经下载好了,放在百度云啦:链接:https://pan.baidu.com/s/1JxnGPSyv8QiDK74o3G2Jug 密码:bn9c

1>.安装JDK

[yinzhengjie@s101 Elk]$ java -version          #配置好java的环境变量后要验证一下当前的版本
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[yinzhengjie@s101 Elk]$ 

2>.导入 the Elasticsearch public GPG key 

[yinzhengjie@s101 ~]$ sudo rpm --import  https://packages.elastic.co/GPG-KEY-elasticsearch 
[sudo] password for yinzhengjie: 
[yinzhengjie@s101 ~]$ 

3>.创建 /etc/yum.repos.d/elasticsearch.repo 仓库文件

[yinzhengjie@s101 ~]$ sudo vi /etc/yum.repos.d/elasticsearch.repo
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/yum.repos.d/elasticsearch.repo 
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x package
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
[yinzhengjie@s101 ~]$ 

4>.通过yum的方式安装Elasticsearch 

[yinzhengjie@s101 ~]$ sudo yum -y install elasticsearch 
Loaded plugins: fastestmirror
base                                                                                                                                                            | 3.6 kB  00:00:00     
elasticsearch-2.x                                                                                                                                               | 2.9 kB  00:00:00     
extras                                                                                                                                                          | 3.4 kB  00:00:00     
mysql-connectors-community                                                                                                                                      | 2.5 kB  00:00:00     
mysql-tools-community                                                                                                                                           | 2.5 kB  00:00:00     
mysql56-community                                                                                                                                               | 2.5 kB  00:00:00     
updates                                                                                                                                                         | 3.4 kB  00:00:00     
elasticsearch-2.x/primary_db                                                                                                                                    | 9.3 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirrors.shu.edu.cn
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.zju.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package elasticsearch.noarch 0:2.4.6-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                       Arch                                   Version                                  Repository                                         Size
=======================================================================================================================================================================================
Installing:
 elasticsearch                                 noarch                                 2.4.6-1                                  elasticsearch-2.x                                  26 M

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 26 M
Installed size: 29 M
Downloading packages:
elasticsearch-2.4.6.rpm                                                                                                                                         |  26 MB  00:02:14     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Creating elasticsearch group... OK
Creating elasticsearch user... OK
  Installing : elasticsearch-2.4.6-1.noarch                                                                                                                                        1/1 
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
  Verifying  : elasticsearch-2.4.6-1.noarch                                                                                                                                        1/1 

Installed:
  elasticsearch.noarch 0:2.4.6-1                                                                                                                                                       

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install elasticsearch

5>.配置Elasticsearch 只能本机访问(可选),并且需要开启9200端口

[yinzhengjie@s101 ~]$ su root
Password: 
[root@s101 yinzhengjie]# 
[root@s101 yinzhengjie]# 
[root@s101 yinzhengjie]# cd /etc/elasticsearch/
[root@s101 elasticsearch]# ll
total 8
-rwxr-x--- 1 root elasticsearch 3192 Apr 24  2017 elasticsearch.yml
-rwxr-x--- 1 root elasticsearch 2571 Apr 24  2017 logging.yml
drwxr-x--- 2 root elasticsearch    6 Jul 18  2017 scripts
[root@s101 elasticsearch]# vi elasticsearch.yml 
[root@s101 elasticsearch]# cat elasticsearch.yml  | grep -v ^# | grep -v ^$
network.host: localhost
http.port: 9200
[root@s101 elasticsearch]# exit 
exit
[yinzhengjie@s101 ~]$ 

6>.启动Elasticsearch 

[yinzhengjie@s101 ~]$ sudo systemctl enable  elasticsearch          #设置es开机自启动
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo systemctl start elasticsearch          #启动es
[sudo] password for yinzhengjie: 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ netstat -ano | grep 9200
tcp6       0      0 127.0.0.1:9200          :::*                    LISTEN      off (0.00/0/0)
tcp6       0      0 ::1:9200                :::*                    LISTEN      off (0.00/0/0)
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ curl 127.0.0.1:9200         #使用curl命令验证是否安装成功
{
  "name" : "5oTVm69",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "J5diJzrtRIKhe-6SL_EAaQ",
  "version" : {
    "number" : "5.0.1",
    "build_hash" : "080bb47",
    "build_date" : "2016-11-11T22:08:49.812Z",
    "build_snapshot" : false,
    "lucene_version" : "6.2.1"
  },
  "tagline" : "You Know, for Search"
}
[yinzhengjie@s101 ~]$ 

三.Kibana-安装-配置

1>.安装public GPG key 

   由于Kibana和Elasticsearch是公用同一key,因此我们这里就省去安装的步骤了。

2>.添加Kibana仓库配置文件

[yinzhengjie@s101 ~]$ su root
Password: 
[root@s101 yinzhengjie]# vi /etc/yum.repos.d/kibana.repo
[root@s101 yinzhengjie]# 
[root@s101 yinzhengjie]# 
[root@s101 yinzhengjie]# more /etc/yum.repos.d/kibana.repo 
[kibana-4.4]
name=Kibana repository for 4.4.x packages
baseurl=http://packages.elastic.co/kibana/4.4/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enable=1
[root@s101 yinzhengjie]# exit 
exit
[yinzhengjie@s101 ~]$ 

3>.通过yum方式安装Kibana

[yinzhengjie@s101 ~]$ sudo yum -y install kibana
[sudo] password for yinzhengjie: 
Loaded plugins: fastestmirror
base                                                                                                                                                            | 3.6 kB  00:00:00     
extras                                                                                                                                                          | 3.4 kB  00:00:00     
kibana-4.4                                                                                                                                                      | 2.9 kB  00:00:00     
updates                                                                                                                                                         | 3.4 kB  00:00:00     
(1/3): extras/7/x86_64/primary_db                                                                                                                               | 187 kB  00:00:00     
(2/3): kibana-4.4/primary_db                                                                                                                                    |  18 kB  00:00:00     
(3/3): updates/7/x86_64/primary_db                                                                                                                              | 5.2 MB  00:00:02     
Determining fastest mirrors
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package kibana.x86_64 0:4.4.2-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                   Arch                                      Version                                       Repository                                     Size
=======================================================================================================================================================================================
Installing:
 kibana                                    x86_64                                    4.4.2-1                                       kibana-4.4                                     32 M

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 32 M
Installed size: 32 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/kibana-4.4/packages/kibana-4.4.2-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID d88e42b4: NOKEY================-] 258 kB/s |  32 MB  00:00:00 ETA 
Public key for kibana-4.4.2-1.x86_64.rpm is not installed
kibana-4.4.2-1.x86_64.rpm                                                                                                                                       |  32 MB  00:02:12     
Retrieving key from http://packages.elastic.co/GPG-KEY-elasticsearch
Importing GPG key 0xD88E42B4:
 Userid     : "Elasticsearch (Elasticsearch Signing Key) <dev_ops@elasticsearch.org>"
 Fingerprint: 4609 5acc 8548 582c 1a26 99a9 d27d 666c d88e 42b4
 From       : http://packages.elastic.co/GPG-KEY-elasticsearch
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kibana-4.4.2-1.x86_64                                                                                                                                               1/1 
  Verifying  : kibana-4.4.2-1.x86_64                                                                                                                                               1/1 

Installed:
  kibana.x86_64 0:4.4.2-1                                                                                                                                                              

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install kibana

4>.编辑Kibana的配置文件,修改默认的服务器主机IP为本机

[yinzhengjie@s101 ~]$ grep -v ^# /opt/kibana/config/kibana.yml  | grep -v ^$
server.host: "localhost"
[yinzhengjie@s101 ~]$ 

5>.启动Kibana并设置开机自启

[yinzhengjie@s101 ~]$ sudo systemctl start kibana
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo chkconfig  kibana on
Note: Forwarding request to 'systemctl enable kibana.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /usr/lib/systemd/system/kibana.service.
[yinzhengjie@s101 ~]$ 

  在我们使用Kibana的webUI之前,我们需要设置反向代理,常用的反向代理服务器有很多,比如ha-proxy,nginx等等,本篇博客采用的是nginx进行反向代理。

 

四.Nginx的配置安装

1>.添加epel仓库

[yinzhengjie@s101 ~]$ sudo yum -y install epel-release
[sudo] password for yinzhengjie: 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                          Arch                                       Version                                  Repository                                  Size
=======================================================================================================================================================================================
Installing:
 epel-release                                     noarch                                     7-11                                     extras                                      15 k

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                                    |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                                            1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                                            1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                                           

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install epel-release

2>.安装nginx和httpd-tools软件包

[yinzhengjie@s101 ~]$ sudo yum -y install nginx httpd-tools
Loaded plugins: fastestmirror
epel/x86_64/metalink                                                                                                                                            | 5.6 kB  00:00:00     
epel                                                                                                                                                            | 3.2 kB  00:00:00     
(1/3): epel/x86_64/updateinfo                                                                                                                                   | 937 kB  00:00:01     
(2/3): epel/x86_64/group_gz                                                                                                                                     |  88 kB  00:00:02     
(3/3): epel/x86_64/primary                                                                                                                                      | 3.6 MB  00:00:23     
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
epel                                                                                                                                                                       12662/12662
Resolving Dependencies
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-80.el7.centos.1 will be installed
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-tools-2.4.6-80.el7.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-tools-2.4.6-80.el7.centos.1.x86_64
---> Package nginx.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: nginx-filesystem = 1:1.12.2-2.el7 for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: nginx-all-modules = 1:1.12.2-2.el7 for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: libprofiler.so.0()(64bit) for package: 1:nginx-1.12.2-2.el7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package gperftools-libs.x86_64 0:2.6.1-1.el7 will be installed
---> Package nginx-all-modules.noarch 1:1.12.2-2.el7 will be installed
--> Processing Dependency: nginx-mod-stream = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
---> Package nginx-filesystem.noarch 1:1.12.2-2.el7 will be installed
---> Package openssl-libs.x86_64 1:1.0.1e-42.el7.9 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-42.el7.9 for package: 1:openssl-1.0.1e-42.el7.9.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-12.el7 will be an update
--> Running transaction check
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: GeoIP for package: 1:nginx-mod-http-geoip-1.12.2-2.el7.x86_64
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: 1:nginx-mod-http-geoip-1.12.2-2.el7.x86_64
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: gd for package: 1:nginx-mod-http-image-filter-1.12.2-2.el7.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: 1:nginx-mod-http-image-filter-1.12.2-2.el7.x86_64
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: perl >= 5.006001 for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(warnings) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(strict) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(constant) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(XSLoader) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(Exporter) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: perl(:MODULE_COMPAT_5.16.3) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64
---> Package nginx-mod-mail.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.12.2-2.el7 will be installed
---> Package openssl.x86_64 1:1.0.1e-42.el7.9 will be updated
---> Package openssl.x86_64 1:1.0.2k-12.el7 will be an update
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be installed
---> Package gd.x86_64 0:2.0.35-26.el7 will be installed
--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libpng15.so.15()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-26.el7.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd-2.0.35-26.el7.x86_64
---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed
---> Package perl.x86_64 4:5.16.3-292.el7 will be installed
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-292.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-292.el7.x86_64
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-libs.x86_64 4:5.16.3-292.el7 will be installed
--> Running transaction check
---> Package fontconfig.x86_64 0:2.10.95-11.el7 will be installed
--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.10.95-11.el7.x86_64
--> Processing Dependency: font(:lang=en) for package: fontconfig-2.10.95-11.el7.x86_64
---> Package libX11.x86_64 0:1.6.5-1.el7 will be installed
--> Processing Dependency: libX11-common >= 1.6.5-1.el7 for package: libX11-1.6.5-1.el7.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.5-1.el7.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.el7 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.90-5.el7 will be installed
---> Package libpng.x86_64 2:1.5.13-7.el7_2 will be installed
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-292.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
--> Running transaction check
---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed
---> Package libX11-common.noarch 0:1.6.5-1.el7 will be installed
---> Package libxcb.x86_64 0:1.12-1.el7 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.el7.x86_64
---> Package lyx-fonts.noarch 0:2.2.3-1.el7 will be installed
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-292.el7 will be installed
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                                Arch                              Version                                             Repository                          Size
=======================================================================================================================================================================================
Installing:
 httpd-tools                                            x86_64                            2.4.6-80.el7.centos.1                               updates                             90 k
 nginx                                                  x86_64                            1:1.12.2-2.el7                                      epel                               530 k
Installing for dependencies:
 GeoIP                                                  x86_64                            1.5.0-11.el7                                        base                               1.1 M
 apr                                                    x86_64                            1.4.8-3.el7_4.1                                     base                               103 k
 apr-util                                               x86_64                            1.5.2-6.el7                                         base                                92 k
 fontconfig                                             x86_64                            2.10.95-11.el7                                      base                               229 k
 fontpackages-filesystem                                noarch                            1.44-8.el7                                          base                               9.9 k
 gd                                                     x86_64                            2.0.35-26.el7                                       base                               146 k
 gperftools-libs                                        x86_64                            2.6.1-1.el7                                         base                               272 k
 libX11                                                 x86_64                            1.6.5-1.el7                                         base                               606 k
 libX11-common                                          noarch                            1.6.5-1.el7                                         base                               164 k
 libXau                                                 x86_64                            1.0.8-2.1.el7                                       base                                29 k
 libXpm                                                 x86_64                            3.5.12-1.el7                                        base                                55 k
 libjpeg-turbo                                          x86_64                            1.2.90-5.el7                                        base                               134 k
 libpng                                                 x86_64                            2:1.5.13-7.el7_2                                    base                               213 k
 libxcb                                                 x86_64                            1.12-1.el7                                          base                               211 k
 libxslt                                                x86_64                            1.1.28-5.el7                                        base                               242 k
 lyx-fonts                                              noarch                            2.2.3-1.el7                                         epel                               159 k
 nginx-all-modules                                      noarch                            1:1.12.2-2.el7                                      epel                                16 k
 nginx-filesystem                                       noarch                            1:1.12.2-2.el7                                      epel                                17 k
 nginx-mod-http-geoip                                   x86_64                            1:1.12.2-2.el7                                      epel                                23 k
 nginx-mod-http-image-filter                            x86_64                            1:1.12.2-2.el7                                      epel                                26 k
 nginx-mod-http-perl                                    x86_64                            1:1.12.2-2.el7                                      epel                                36 k
 nginx-mod-http-xslt-filter                             x86_64                            1:1.12.2-2.el7                                      epel                                26 k
 nginx-mod-mail                                         x86_64                            1:1.12.2-2.el7                                      epel                                54 k
 nginx-mod-stream                                       x86_64                            1:1.12.2-2.el7                                      epel                                76 k
 perl                                                   x86_64                            4:5.16.3-292.el7                                    base                               8.0 M
 perl-Carp                                              noarch                            1.26-244.el7                                        base                                19 k
 perl-Encode                                            x86_64                            2.51-7.el7                                          base                               1.5 M
 perl-Exporter                                          noarch                            5.68-3.el7                                          base                                28 k
 perl-File-Path                                         noarch                            2.09-2.el7                                          base                                26 k
 perl-File-Temp                                         noarch                            0.23.01-3.el7                                       base                                56 k
 perl-Filter                                            x86_64                            1.49-3.el7                                          base                                76 k
 perl-Getopt-Long                                       noarch                            2.40-3.el7                                          base                                56 k
 perl-HTTP-Tiny                                         noarch                            0.033-3.el7                                         base                                38 k
 perl-PathTools                                         x86_64                            3.40-5.el7                                          base                                82 k
 perl-Pod-Escapes                                       noarch                            1:1.04-292.el7                                      base                                51 k
 perl-Pod-Perldoc                                       noarch                            3.20-4.el7                                          base                                87 k
 perl-Pod-Simple                                        noarch                            1:3.28-4.el7                                        base                               216 k
 perl-Pod-Usage                                         noarch                            1.63-3.el7                                          base                                27 k
 perl-Scalar-List-Utils                                 x86_64                            1.27-248.el7                                        base                                36 k
 perl-Socket                                            x86_64                            2.010-4.el7                                         base                                49 k
 perl-Storable                                          x86_64                            2.45-3.el7                                          base                                77 k
 perl-Text-ParseWords                                   noarch                            3.29-4.el7                                          base                                14 k
 perl-Time-HiRes                                        x86_64                            4:1.9725-3.el7                                      base                                45 k
 perl-Time-Local                                        noarch                            1.2300-2.el7                                        base                                24 k
 perl-constant                                          noarch                            1.27-2.el7                                          base                                19 k
 perl-libs                                              x86_64                            4:5.16.3-292.el7                                    base                               688 k
 perl-macros                                            x86_64                            4:5.16.3-292.el7                                    base                                43 k
 perl-parent                                            noarch                            1:0.225-244.el7                                     base                                12 k
 perl-podlators                                         noarch                            2.5.1-3.el7                                         base                               112 k
 perl-threads                                           x86_64                            1.87-4.el7                                          base                                49 k
 perl-threads-shared                                    x86_64                            1.43-6.el7                                          base                                39 k
Updating for dependencies:
 openssl                                                x86_64                            1:1.0.2k-12.el7                                     base                               492 k
 openssl-libs                                           x86_64                            1:1.0.2k-12.el7                                     base                               1.2 M

Transaction Summary
=======================================================================================================================================================================================
Install  2 Packages (+51 Dependent packages)
Upgrade             (  2 Dependent packages)

Total download size: 18 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/55): apr-1.4.8-3.el7_4.1.x86_64.rpm                                                                                                                          | 103 kB  00:00:00     
(2/55): gd-2.0.35-26.el7.x86_64.rpm                                                                                                                             | 146 kB  00:00:00     
(3/55): fontconfig-2.10.95-11.el7.x86_64.rpm                                                                                                                    | 229 kB  00:00:00     
(4/55): gperftools-libs-2.6.1-1.el7.x86_64.rpm                                                                                                                  | 272 kB  00:00:00     
(5/55): libX11-1.6.5-1.el7.x86_64.rpm                                                                                                                           | 606 kB  00:00:00     
(6/55): libX11-common-1.6.5-1.el7.noarch.rpm                                                                                                                    | 164 kB  00:00:00     
(7/55): GeoIP-1.5.0-11.el7.x86_64.rpm                                                                                                                           | 1.1 MB  00:00:00     
(8/55): libXau-1.0.8-2.1.el7.x86_64.rpm                                                                                                                         |  29 kB  00:00:00     
(9/55): libXpm-3.5.12-1.el7.x86_64.rpm                                                                                                                          |  55 kB  00:00:00     
(10/55): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm                                                                                                                  | 134 kB  00:00:00     
(11/55): libpng-1.5.13-7.el7_2.x86_64.rpm                                                                                                                       | 213 kB  00:00:00     
(12/55): libxcb-1.12-1.el7.x86_64.rpm                                                                                                                           | 211 kB  00:00:00     
(13/55): libxslt-1.1.28-5.el7.x86_64.rpm                                                                                                                        | 242 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/epel/packages/lyx-fonts-2.2.3-1.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY              ] 1.6 MB/s | 3.4 MB  00:00:09 ETA 
Public key for lyx-fonts-2.2.3-1.el7.noarch.rpm is not installed
(14/55): lyx-fonts-2.2.3-1.el7.noarch.rpm                                                                                                                       | 159 kB  00:00:00     
(15/55): nginx-all-modules-1.12.2-2.el7.noarch.rpm                                                                                                              |  16 kB  00:00:00     
(16/55): nginx-filesystem-1.12.2-2.el7.noarch.rpm                                                                                                               |  17 kB  00:00:00     
(17/55): nginx-mod-http-geoip-1.12.2-2.el7.x86_64.rpm                                                                                                           |  23 kB  00:00:00     
(18/55): nginx-mod-http-image-filter-1.12.2-2.el7.x86_64.rpm                                                                                                    |  26 kB  00:00:00     
(19/55): nginx-mod-http-perl-1.12.2-2.el7.x86_64.rpm                                                                                                            |  36 kB  00:00:00     
(20/55): nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64.rpm                                                                                                     |  26 kB  00:00:00     
(21/55): nginx-mod-mail-1.12.2-2.el7.x86_64.rpm                                                                                                                 |  54 kB  00:00:00     
(22/55): nginx-mod-stream-1.12.2-2.el7.x86_64.rpm                                                                                                               |  76 kB  00:00:00     
(23/55): openssl-1.0.2k-12.el7.x86_64.rpm                                                                                                                       | 492 kB  00:00:00     
(24/55): openssl-libs-1.0.2k-12.el7.x86_64.rpm                                                                                                                  | 1.2 MB  00:00:00     
(25/55): nginx-1.12.2-2.el7.x86_64.rpm                                                                                                                          | 530 kB  00:00:05     
(26/55): perl-5.16.3-292.el7.x86_64.rpm                                                                                                                         | 8.0 MB  00:00:04     
(27/55): perl-Encode-2.51-7.el7.x86_64.rpm                                                                                                                      | 1.5 MB  00:00:00     
(28/55): perl-Exporter-5.68-3.el7.noarch.rpm                                                                                                                    |  28 kB  00:00:00     
(29/55): perl-File-Path-2.09-2.el7.noarch.rpm                                                                                                                   |  26 kB  00:00:00     
(30/55): perl-File-Temp-0.23.01-3.el7.noarch.rpm                                                                                                                |  56 kB  00:00:00     
(31/55): perl-Filter-1.49-3.el7.x86_64.rpm                                                                                                                      |  76 kB  00:00:00     
(32/55): perl-Getopt-Long-2.40-3.el7.noarch.rpm                                                                                                                 |  56 kB  00:00:00     
(33/55): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm                                                                                                                  |  38 kB  00:00:00     
(34/55): perl-PathTools-3.40-5.el7.x86_64.rpm                                                                                                                   |  82 kB  00:00:00     
(35/55): perl-Pod-Escapes-1.04-292.el7.noarch.rpm                                                                                                               |  51 kB  00:00:00     
(36/55): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm                                                                                                                 |  87 kB  00:00:00     
(37/55): perl-Pod-Simple-3.28-4.el7.noarch.rpm                                                                                                                  | 216 kB  00:00:00     
(38/55): perl-Pod-Usage-1.63-3.el7.noarch.rpm                                                                                                                   |  27 kB  00:00:00     
(39/55): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm                                                                                                         |  36 kB  00:00:00     
(40/55): perl-Socket-2.010-4.el7.x86_64.rpm                                                                                                                     |  49 kB  00:00:00     
(41/55): perl-Storable-2.45-3.el7.x86_64.rpm                                                                                                                    |  77 kB  00:00:00     
(42/55): perl-Text-ParseWords-3.29-4.el7.noarch.rpm                                                                                                             |  14 kB  00:00:00     
(43/55): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm                                                                                                                |  45 kB  00:00:00     
(44/55): perl-Time-Local-1.2300-2.el7.noarch.rpm                                                                                                                |  24 kB  00:00:00     
(45/55): perl-constant-1.27-2.el7.noarch.rpm                                                                                                                    |  19 kB  00:00:00     
(46/55): perl-libs-5.16.3-292.el7.x86_64.rpm                                                                                                                    | 688 kB  00:00:00     
(47/55): perl-macros-5.16.3-292.el7.x86_64.rpm                                                                                                                  |  43 kB  00:00:00     
(48/55): perl-parent-0.225-244.el7.noarch.rpm                                                                                                                   |  12 kB  00:00:00     
(49/55): perl-podlators-2.5.1-3.el7.noarch.rpm                                                                                                                  | 112 kB  00:00:00     
(50/55): perl-threads-1.87-4.el7.x86_64.rpm                                                                                                                     |  49 kB  00:00:00     
(51/55): perl-threads-shared-1.43-6.el7.x86_64.rpm                                                                                                              |  39 kB  00:00:00     
(52/55): apr-util-1.5.2-6.el7.x86_64.rpm                                                                                                                        |  92 kB  00:00:10     
(53/55): httpd-tools-2.4.6-80.el7.centos.1.x86_64.rpm                                                                                                           |  90 kB  00:00:10     
(54/55): perl-Carp-1.26-244.el7.noarch.rpm                                                                                                                      |  19 kB  00:00:04     
(55/55): fontpackages-filesystem-1.44-8.el7.noarch.rpm                                                                                                          | 9.9 kB  00:00:16     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                  1.0 MB/s |  18 MB  00:00:16     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 1:openssl-libs-1.0.2k-12.el7.x86_64                                                                                                                                1/57 
  Installing : apr-1.4.8-3.el7_4.1.x86_64                                                                                                                                         2/57 
  Installing : fontpackages-filesystem-1.44-8.el7.noarch                                                                                                                          3/57 
  Installing : lyx-fonts-2.2.3-1.el7.noarch                                                                                                                                       4/57 
  Installing : fontconfig-2.10.95-11.el7.x86_64                                                                                                                                   5/57 
  Installing : apr-util-1.5.2-6.el7.x86_64                                                                                                                                        6/57 
  Updating   : 1:openssl-1.0.2k-12.el7.x86_64                                                                                                                                     7/57 
  Installing : 1:perl-parent-0.225-244.el7.noarch                                                                                                                                 8/57 
  Installing : perl-HTTP-Tiny-0.033-3.el7.noarch                                                                                                                                  9/57 
  Installing : perl-podlators-2.5.1-3.el7.noarch                                                                                                                                 10/57 
  Installing : perl-Pod-Perldoc-3.20-4.el7.noarch                                                                                                                                11/57 
  Installing : perl-Encode-2.51-7.el7.x86_64                                                                                                                                     12/57 
  Installing : perl-Text-ParseWords-3.29-4.el7.noarch                                                                                                                            13/57 
  Installing : 1:perl-Pod-Escapes-1.04-292.el7.noarch                                                                                                                            14/57 
  Installing : perl-Pod-Usage-1.63-3.el7.noarch                                                                                                                                  15/57 
  Installing : 4:perl-libs-5.16.3-292.el7.x86_64                                                                                                                                 16/57 
  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                                                                                             17/57 
  Installing : perl-Exporter-5.68-3.el7.noarch                                                                                                                                   18/57 
  Installing : perl-constant-1.27-2.el7.noarch                                                                                                                                   19/57 
  Installing : perl-Filter-1.49-3.el7.x86_64                                                                                                                                     20/57 
  Installing : perl-Time-Local-1.2300-2.el7.noarch                                                                                                                               21/57 
  Installing : perl-Socket-2.010-4.el7.x86_64                                                                                                                                    22/57 
  Installing : perl-Carp-1.26-244.el7.noarch                                                                                                                                     23/57 
  Installing : perl-Storable-2.45-3.el7.x86_64                                                                                                                                   24/57 
  Installing : perl-PathTools-3.40-5.el7.x86_64                                                                                                                                  25/57 
  Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64                                                                                                                        26/57 
  Installing : perl-threads-shared-1.43-6.el7.x86_64                                                                                                                             27/57 
  Installing : perl-threads-1.87-4.el7.x86_64                                                                                                                                    28/57 
  Installing : 4:perl-macros-5.16.3-292.el7.x86_64                                                                                                                               29/57 
  Installing : perl-File-Temp-0.23.01-3.el7.noarch                                                                                                                               30/57 
  Installing : perl-File-Path-2.09-2.el7.noarch                                                                                                                                  31/57 
  Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch                                                                                                                               32/57 
  Installing : perl-Getopt-Long-2.40-3.el7.noarch                                                                                                                                33/57 
  Installing : 4:perl-5.16.3-292.el7.x86_64                                                                                                                                      34/57 
  Installing : gperftools-libs-2.6.1-1.el7.x86_64                                                                                                                                35/57 
  Installing : GeoIP-1.5.0-11.el7.x86_64                                                                                                                                         36/57 
  Installing : libXau-1.0.8-2.1.el7.x86_64                                                                                                                                       37/57 
  Installing : libxcb-1.12-1.el7.x86_64                                                                                                                                          38/57 
  Installing : libX11-common-1.6.5-1.el7.noarch                                                                                                                                  39/57 
  Installing : libX11-1.6.5-1.el7.x86_64                                                                                                                                         40/57 
  Installing : libXpm-3.5.12-1.el7.x86_64                                                                                                                                        41/57 
  Installing : libxslt-1.1.28-5.el7.x86_64                                                                                                                                       42/57 
  Installing : 1:nginx-filesystem-1.12.2-2.el7.noarch                                                                                                                            43/57 
  Installing : libjpeg-turbo-1.2.90-5.el7.x86_64                                                                                                                                 44/57 
  Installing : 2:libpng-1.5.13-7.el7_2.x86_64                                                                                                                                    45/57 
  Installing : gd-2.0.35-26.el7.x86_64                                                                                                                                           46/57 
  Installing : 1:nginx-mod-http-geoip-1.12.2-2.el7.x86_64                                                                                                                        47/57 
  Installing : 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64                                                                                                                  48/57 
  Installing : 1:nginx-mod-stream-1.12.2-2.el7.x86_64                                                                                                                            49/57 
  Installing : 1:nginx-mod-mail-1.12.2-2.el7.x86_64                                                                                                                              50/57 
  Installing : 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64                                                                                                                         51/57 
  Installing : 1:nginx-1.12.2-2.el7.x86_64                                                                                                                                       52/57 
  Installing : 1:nginx-mod-http-image-filter-1.12.2-2.el7.x86_64                                                                                                                 53/57 
  Installing : 1:nginx-all-modules-1.12.2-2.el7.noarch                                                                                                                           54/57 
  Installing : httpd-tools-2.4.6-80.el7.centos.1.x86_64                                                                                                                          55/57 
  Cleanup    : 1:openssl-1.0.1e-42.el7.9.x86_64                                                                                                                                  56/57 
  Cleanup    : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                                                                                                                             57/57 
  Verifying  : libX11-1.6.5-1.el7.x86_64                                                                                                                                          1/57 
  Verifying  : lyx-fonts-2.2.3-1.el7.noarch                                                                                                                                       2/57 
  Verifying  : 2:libpng-1.5.13-7.el7_2.x86_64                                                                                                                                     3/57 
  Verifying  : perl-HTTP-Tiny-0.033-3.el7.noarch                                                                                                                                  4/57 
  Verifying  : libjpeg-turbo-1.2.90-5.el7.x86_64                                                                                                                                  5/57 
  Verifying  : httpd-tools-2.4.6-80.el7.centos.1.x86_64                                                                                                                           6/57 
  Verifying  : perl-threads-shared-1.43-6.el7.x86_64                                                                                                                              7/57 
  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                                                                                              8/57 
  Verifying  : 1:nginx-mod-http-geoip-1.12.2-2.el7.x86_64                                                                                                                         9/57 
  Verifying  : perl-Exporter-5.68-3.el7.noarch                                                                                                                                   10/57 
  Verifying  : perl-constant-1.27-2.el7.noarch                                                                                                                                   11/57 
  Verifying  : perl-PathTools-3.40-5.el7.x86_64                                                                                                                                  12/57 
  Verifying  : libxcb-1.12-1.el7.x86_64                                                                                                                                          13/57 
  Verifying  : perl-Encode-2.51-7.el7.x86_64                                                                                                                                     14/57 
  Verifying  : 1:nginx-mod-http-xslt-filter-1.12.2-2.el7.x86_64                                                                                                                  15/57 
  Verifying  : 1:openssl-libs-1.0.2k-12.el7.x86_64                                                                                                                               16/57 
  Verifying  : 1:nginx-mod-stream-1.12.2-2.el7.x86_64                                                                                                                            17/57 
  Verifying  : 1:perl-parent-0.225-244.el7.noarch                                                                                                                                18/57 
  Verifying  : 4:perl-5.16.3-292.el7.x86_64                                                                                                                                      19/57 
  Verifying  : fontpackages-filesystem-1.44-8.el7.noarch                                                                                                                         20/57 
  Verifying  : 1:nginx-1.12.2-2.el7.x86_64                                                                                                                                       21/57 
  Verifying  : perl-Filter-1.49-3.el7.x86_64                                                                                                                                     22/57 
  Verifying  : perl-File-Temp-0.23.01-3.el7.noarch                                                                                                                               23/57 
  Verifying  : 1:perl-Pod-Simple-3.28-4.el7.noarch                                                                                                                               24/57 
  Verifying  : 1:nginx-all-modules-1.12.2-2.el7.noarch                                                                                                                           25/57 
  Verifying  : 4:perl-libs-5.16.3-292.el7.x86_64                                                                                                                                 26/57 
  Verifying  : perl-Time-Local-1.2300-2.el7.noarch                                                                                                                               27/57 
  Verifying  : perl-Socket-2.010-4.el7.x86_64                                                                                                                                    28/57 
  Verifying  : libXpm-3.5.12-1.el7.x86_64                                                                                                                                        29/57 
  Verifying  : perl-Text-ParseWords-3.29-4.el7.noarch                                                                                                                            30/57 
  Verifying  : 1:nginx-filesystem-1.12.2-2.el7.noarch                                                                                                                            31/57 
  Verifying  : perl-Carp-1.26-244.el7.noarch                                                                                                                                     32/57 
  Verifying  : libxslt-1.1.28-5.el7.x86_64                                                                                                                                       33/57 
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                                                                                                                       34/57 
  Verifying  : perl-Storable-2.45-3.el7.x86_64                                                                                                                                   35/57 
  Verifying  : 1:nginx-mod-mail-1.12.2-2.el7.x86_64                                                                                                                              36/57 
  Verifying  : perl-Scalar-List-Utils-1.27-248.el7.x86_64                                                                                                                        37/57 
  Verifying  : gd-2.0.35-26.el7.x86_64                                                                                                                                           38/57 
  Verifying  : 1:perl-Pod-Escapes-1.04-292.el7.noarch                                                                                                                            39/57 
  Verifying  : perl-Pod-Usage-1.63-3.el7.noarch                                                                                                                                  40/57 
  Verifying  : apr-1.4.8-3.el7_4.1.x86_64                                                                                                                                        41/57 
  Verifying  : libX11-common-1.6.5-1.el7.noarch                                                                                                                                  42/57 
  Verifying  : perl-Pod-Perldoc-3.20-4.el7.noarch                                                                                                                                43/57 
  Verifying  : perl-podlators-2.5.1-3.el7.noarch                                                                                                                                 44/57 
  Verifying  : libXau-1.0.8-2.1.el7.x86_64                                                                                                                                       45/57 
  Verifying  : GeoIP-1.5.0-11.el7.x86_64                                                                                                                                         46/57 
  Verifying  : fontconfig-2.10.95-11.el7.x86_64                                                                                                                                  47/57 
  Verifying  : perl-threads-1.87-4.el7.x86_64                                                                                                                                    48/57 
  Verifying  : gperftools-libs-2.6.1-1.el7.x86_64                                                                                                                                49/57 
  Verifying  : 4:perl-macros-5.16.3-292.el7.x86_64                                                                                                                               50/57 
  Verifying  : perl-Getopt-Long-2.40-3.el7.noarch                                                                                                                                51/57 
  Verifying  : 1:nginx-mod-http-perl-1.12.2-2.el7.x86_64                                                                                                                         52/57 
  Verifying  : perl-File-Path-2.09-2.el7.noarch                                                                                                                                  53/57 
  Verifying  : 1:nginx-mod-http-image-filter-1.12.2-2.el7.x86_64                                                                                                                 54/57 
  Verifying  : 1:openssl-1.0.2k-12.el7.x86_64                                                                                                                                    55/57 
  Verifying  : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                                                                                                                             56/57 
  Verifying  : 1:openssl-1.0.1e-42.el7.9.x86_64                                                                                                                                  57/57 

Installed:
  httpd-tools.x86_64 0:2.4.6-80.el7.centos.1                                                        nginx.x86_64 1:1.12.2-2.el7                                                       

Dependency Installed:
  GeoIP.x86_64 0:1.5.0-11.el7                                  apr.x86_64 0:1.4.8-3.el7_4.1                                  apr-util.x86_64 0:1.5.2-6.el7                           
  fontconfig.x86_64 0:2.10.95-11.el7                           fontpackages-filesystem.noarch 0:1.44-8.el7                   gd.x86_64 0:2.0.35-26.el7                               
  gperftools-libs.x86_64 0:2.6.1-1.el7                         libX11.x86_64 0:1.6.5-1.el7                                   libX11-common.noarch 0:1.6.5-1.el7                      
  libXau.x86_64 0:1.0.8-2.1.el7                                libXpm.x86_64 0:3.5.12-1.el7                                  libjpeg-turbo.x86_64 0:1.2.90-5.el7                     
  libpng.x86_64 2:1.5.13-7.el7_2                               libxcb.x86_64 0:1.12-1.el7                                    libxslt.x86_64 0:1.1.28-5.el7                           
  lyx-fonts.noarch 0:2.2.3-1.el7                               nginx-all-modules.noarch 1:1.12.2-2.el7                       nginx-filesystem.noarch 1:1.12.2-2.el7                  
  nginx-mod-http-geoip.x86_64 1:1.12.2-2.el7                   nginx-mod-http-image-filter.x86_64 1:1.12.2-2.el7             nginx-mod-http-perl.x86_64 1:1.12.2-2.el7               
  nginx-mod-http-xslt-filter.x86_64 1:1.12.2-2.el7             nginx-mod-mail.x86_64 1:1.12.2-2.el7                          nginx-mod-stream.x86_64 1:1.12.2-2.el7                  
  perl.x86_64 4:5.16.3-292.el7                                 perl-Carp.noarch 0:1.26-244.el7                               perl-Encode.x86_64 0:2.51-7.el7                         
  perl-Exporter.noarch 0:5.68-3.el7                            perl-File-Path.noarch 0:2.09-2.el7                            perl-File-Temp.noarch 0:0.23.01-3.el7                   
  perl-Filter.x86_64 0:1.49-3.el7                              perl-Getopt-Long.noarch 0:2.40-3.el7                          perl-HTTP-Tiny.noarch 0:0.033-3.el7                     
  perl-PathTools.x86_64 0:3.40-5.el7                           perl-Pod-Escapes.noarch 1:1.04-292.el7                        perl-Pod-Perldoc.noarch 0:3.20-4.el7                    
  perl-Pod-Simple.noarch 1:3.28-4.el7                          perl-Pod-Usage.noarch 0:1.63-3.el7                            perl-Scalar-List-Utils.x86_64 0:1.27-248.el7            
  perl-Socket.x86_64 0:2.010-4.el7                             perl-Storable.x86_64 0:2.45-3.el7                             perl-Text-ParseWords.noarch 0:3.29-4.el7                
  perl-Time-HiRes.x86_64 4:1.9725-3.el7                        perl-Time-Local.noarch 0:1.2300-2.el7                         perl-constant.noarch 0:1.27-2.el7                       
  perl-libs.x86_64 4:5.16.3-292.el7                            perl-macros.x86_64 4:5.16.3-292.el7                           perl-parent.noarch 1:0.225-244.el7                      
  perl-podlators.noarch 0:2.5.1-3.el7                          perl-threads.x86_64 0:1.87-4.el7                              perl-threads-shared.x86_64 0:1.43-6.el7                 

Dependency Updated:
  openssl.x86_64 1:1.0.2k-12.el7                                                          openssl-libs.x86_64 1:1.0.2k-12.el7                                                         

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install nginx httpd-tools

3>.通过htpasswd命令创建访问Kibana webUI的账号

[yinzhengjie@s101 ~]$ sudo htpasswd -c /etc/nginx/htpasswd.users yinzhengjie       #注意,这个“yinzhengjie”是用户名,下面需要输入两边密码哟!
[sudo] password for yinzhengjie: 
New password: 
Re-type new password: 
Adding password for user yinzhengjie
[yinzhengjie@s101 ~]$ 

4>.编辑nginx的配置文件,通过include指令添加包含单独的一个Kibana的配置文件

[yinzhengjie@s101 ~]$ sudo cp  /etc/nginx/nginx.conf  /etc/nginx/nginx.conf.bak        #备份文件
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo vi /etc/nginx/nginx.conf                                    #修改文件
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/nginx/nginx.conf                                    #查看修改后的文件内容
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    include /etc/nginx/conf.d/*.conf;                               #这行注释就是加载“/etc/nginx/conf.d/”目录下的所有配置文件。
}

[yinzhengjie@s101 ~]$ 

5>.创建并编辑新文件kabana.conf配置文件

[yinzhengjie@s101 ~]$ sudo vi /etc/nginx/conf.d/kabana.conf
[sudo] password for yinzhengjie: 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/nginx/conf.d/kabana.conf 
server {
    listen 80;
    
    server_name s101;
    
    auth_basic "Restricted Access";                                #指定认证的机制为"Restricted Access"
    auth_basic_user_file /etc/nginx/htpasswd.users;                #通过指定文件中存在的用户进行认证

    location / {
        proxy_pass http://localhost:5601;
        
        proxy_http_version 1.1;
        
        proxy_set_header Upgrade $http_upgrade;
        
        proxy_set_header Connection 'upgrade';
        
        proxy_set_header Host $host;
        
        proxy_cache_bypass $http_upgrade;
    }
}
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo nginx -t                                #检查nginx配置文件是否配置错误
[sudo] password for yinzhengjie: 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[yinzhengjie@s101 ~]$ 

6>.启动nginx让变更生效并设置开机自启

[yinzhengjie@s101 ~]$ sudo systemctl start nginx
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ps -ef | grep nginx
root       5090      1  0 08:52 ?        00:00:00 nginx: master process /usr/sbin/nginx
nginx      5091   5090  0 08:52 ?        00:00:00 nginx: worker process
nginx      5092   5090  0 08:52 ?        00:00:00 nginx: worker process
yinzhen+   5112   2281  0 08:53 pts/0    00:00:00 grep --color=auto nginx
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ netstat -untalp | grep 80
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -                   
[yinzhengjie@s101 ~]$ 

五.部署Logstash

1>.安装public GPG key 

   由于Logstash和Elasticsearch是公用同一key,因此我们这里就省去安装的步骤了。

2>.编辑logstash的repo配置文件

[yinzhengjie@s101 ~]$ sudo vi /etc/yum.repos.d/logstash.repo
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/yum.repos.d/logstash.repo 
[logstash-2.2]
name=logstash repository for 2.2 packages
baseurl=http://packages.elasticsearch.org/logstash/2.2/centos
gpgcheck=1
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
enable=1
[yinzhengjie@s101 ~]$ 

3>.通过yum的方式安装logstash

[yinzhengjie@s101 ~]$ sudo yum -y install logstash
Loaded plugins: fastestmirror
logstash-2.2                                                                                                                                                    |  951 B  00:00:00     
logstash-2.2/primary                                                                                                                                            | 2.6 kB  00:00:05     
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
logstash-2.2                                                                                                                                                                       5/5
Resolving Dependencies
--> Running transaction check
---> Package logstash.noarch 1:2.2.4-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                    Arch                                     Version                                      Repository                                      Size
=======================================================================================================================================================================================
Installing:
 logstash                                   noarch                                   1:2.2.4-1                                    logstash-2.2                                    73 M

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 73 M
Installed size: 127 M
Downloading packages:
logstash-2.2.4-1.noarch.rpm                                                                                                                                     |  73 MB  00:07:39     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:logstash-2.2.4-1.noarch                                                                                                                                           1/1 
  Verifying  : 1:logstash-2.2.4-1.noarch                                                                                                                                           1/1 

Installed:
  logstash.noarch 1:2.2.4-1                                                                                                                                                            

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install logstash

4>.生成SSH整数和公私秘钥对,其主要作用是filebeat对ELK服务器进行身份认证的

[yinzhengjie@s101 ~]$ cd /etc/pki/tls
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ sudo openssl req -config /etc/ssl/openssl.cnf -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash-forwarder.key -out certs/logstash-forwarder.crt
Generating a 2048 bit RSA private key
.......................................................................................................+++
.............+++
writing new private key to 'private/logstash-forwarder.key'
-----
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ cd private/
[yinzhengjie@s101 private]$ ll
total 4
-rw-r--r-- 1 root root 1708 Aug 31 09:20 logstash-forwarder.key
[yinzhengjie@s101 private]$ cat logstash-forwarder.key 
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC7EK6cmKLdaeOh
hBF/OV7PP2TvN7PkpqCC5x8wUuv3zH5IT+qea9snwpwcVD96xDvIR2LDsYhy1N6l
ggb3/0vAftO3F0J5LEnGK6rlJx4SEPOGcSY7ZI01dmWut90zwl1LdY1C54rVYQZq
pC5L1huljZQo6k+qq6pzg6nEtzRO+tMNA3HR54qpKtvldF1j0knA8AKrPrnsakeS
Ru+Sd8hpZI5ETaizGn9qaVp46EDfEpmB6vAKuMjYM/TbkCeP2n6RuQg0Fdc/Ctj5
ejeQD7BJuQp49v86cxCS9NlGyPO/auw4qj2n1FprH+6RaU8cnPMktz+C4KeonJW2
WGqvLKEPAgMBAAECggEAP7b04l2Sy3tvjune08iEpG5hQKFmYnDmpu91zg3QVXyP
Xq3pqb/uy2IbrgJ8BKKmAhdeam0jnokmtJTPLtUDxjLshaYkfAU7s4XYFWj3cwvX
BmmvrfcXqagEBjiV3TVMdZE6ZhlbTkZX2ybEpgvtKrxIRI9aRzVlPycPQfNsm6F5
9CSmCNgnuYTFWS/HgEQYFx/uRaAKH5Ok7y2MU3dC6ZuinSb/sQ2GUC5PJ8PQJHBm
Hbn61JRByKzwliSSHBNXxFrI1pFkxLz1uB9HG8IU24eyg/SzyE5Ib4DRfx7EYC8Q
iMh6VKWZvThPmliaZiz8EBEJj9YU30gNW0SxeYVsUQKBgQDg53PMH0jlvpYwSWyH
CHhXCihnajfG0tUH6MqvsCLUp02BB9Xg9SWZ4ZVKkjcqLSPIWAtI7RNS4KSTDvEX
jeY7VfHND3YxCqwk2cb1nqBAnWMTIJ3Hhvz+Xv09nd736Ki1vbB0pxseL8hrvhme
6Alz5WlGk1vFxf47KlfpyGBbEwKBgQDU7ei1qu8CS/FTcKqupwCU13zWtjtRVF+M
GgggCTEexyz/+DY3cdZxi56agjduinmaQDxzFpeaSd9q8FIsvYQxto3Cl/LB9PPE
GTh2LoaeVN7gb10BVCg8wOx43XWtChM9tRBGCuKtk72SQSd+fe+QQSZdTEfLAFt2
SRgY4TbFlQKBgQDH4UwL3L4H2VNXhNncRM3W5WM1TbRWkufbyKviapL6FdqO02zl
KlqJoW/yP3KhnE6R7pXQ8UpcPORnAj+I5Ib6sw5cZeJwAYEumxH1F05rPrVfuXwg
aTsNw1Qj39vazj6qjvR1KFK0iFkCUIgqryQ/iWL/41ULt0SURrStRHVGWwKBgQCh
mt9f4hf8mj7SoVQpsj5SuSnam/xxQaQy5R79kXxia7DPpUcg1Zl4HAuIIQSJNTgN
xmsavi7Zvu9+bl8v7baDNJZq9oAcjRjl4G5l4/HwAWIW3O6tr33KfnH7WbmSV287
Ck0Lm/9m1havBhw/eL11sry3WsmyXNcN83QCjgvP8QKBgQDGikO60eU4AAx4urVS
ePYnuA8HnnpZYDwxGdi0SfMYXOoPN48Zm/EO0dDa1IEXz/c4Hq20T9iUV9NKQDA3
toZ5r6Fl6vODK81+Qtv7g6yZ2QaMTbBjwMEjj18tvJveVYUcjs0pvPkhUqGS5AV8
W7z5loaesKxaOSVPl4zUnkytnA==
-----END PRIVATE KEY-----
[yinzhengjie@s101 private]$ 

  生成的logstash-forwarder.crt证书文件奖杯拷贝到所有的服务器当发送日志给logstash的时候,这个步骤我们以后再做,我们首先是需要完成logstash的配置

[yinzhengjie@s101 ~]$ cd /etc/pki/tls
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ sudo openssl req -config /etc/ssl/openssl.cnf -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash-forwarder.key -out certs/logstash-forwarder.crt
error on line -1 of /etc/ssl/openssl.cnf
139836511934368:error:02001002:system library:fopen:No such file or directory:bss_file.c:175:fopen('/etc/ssl/openssl.cnf','rb')
139836511934368:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:182:
139836511934368:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:195:
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ ll /etc/ssl/
total 0
lrwxrwxrwx. 1 root root 16 Aug  9 19:15 certs -> ../pki/tls/certs
[yinzhengjie@s101 tls]$ ll /etc/ssl/certs/
total 12
lrwxrwxrwx. 1 root root   49 Aug  9 19:15 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx. 1 root root   55 Aug  9 19:15 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
-rwxr-xr-x  1 root root  610 Apr 11 00:58 make-dummy-cert
-rw-r--r--  1 root root 2516 Apr 11 00:58 Makefile
-rwxr-xr-x  1 root root  829 Apr 11 00:58 renew-dummy-cert
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ ln -s /etc/pki/tls/openssl.cnf /etc/ssl/openssl.cnf
ln: failed to create symbolic link ‘/etc/ssl/openssl.cnf’: Permission denied
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ sudo ln -s /etc/pki/tls/openssl.cnf /etc/ssl/openssl.cnf
[sudo] password for yinzhengjie: 
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ ll /etc/ssl/certs/
total 12
lrwxrwxrwx. 1 root root   49 Aug  9 19:15 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx. 1 root root   55 Aug  9 19:15 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
-rwxr-xr-x  1 root root  610 Apr 11 00:58 make-dummy-cert
-rw-r--r--  1 root root 2516 Apr 11 00:58 Makefile
-rwxr-xr-x  1 root root  829 Apr 11 00:58 renew-dummy-cert
[yinzhengjie@s101 tls]$ ll /etc/ssl/
total 0
lrwxrwxrwx. 1 root root 16 Aug  9 19:15 certs -> ../pki/tls/certs
lrwxrwxrwx  1 root root 24 Aug 31 09:20 openssl.cnf -> /etc/pki/tls/openssl.cnf
[yinzhengjie@s101 tls]$ 
[yinzhengjie@s101 tls]$ sudo openssl req -config /etc/ssl/openssl.cnf -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash-forwarder.key -out certs/logstash-forwarder.crt
Generating a 2048 bit RSA private key
.......................................................................................................+++
.............+++
writing new private key to 'private/logstash-forwarder.key'
-----
[yinzhengjie@s101 tls]$ 
创建秘钥证书秘钥需要安装openssl,如果没有按照使用yum安装一下即可,如果安装之后还不可以的话,根据报错信息拍错,比如([yinzhengjie@s101 tls]$ ln -s /etc/pki/tls/openssl.cnf /etc/ssl/openssl.cnf)

六.Logstash-验证配置

  说明:配置使用json格式,在“/etc/logstash/conf.d”下,由input+filter+output组成,注意,命名文件的时候要注意文件开头最好是在02~30之间,因为他要进行排序。

1>.创建input配置文件“02-beats-input.conf”

[yinzhengjie@s101 ~]$ sudo vi /etc/logstash/conf.d/02-beats-input.conf
[sudo] password for yinzhengjie: 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/logstash/conf.d/02-beats-input.conf
input {
  beats {
    port => 5044
    ssl => true
    ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
    ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
  }
}
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ll /etc/pki/tls/certs/logstash-forwarder.crt
-rw-r--r-- 1 root root 1220 Aug 31 09:20 /etc/pki/tls/certs/logstash-forwarder.crt
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ll /etc/pki/tls/private/logstash-forwarder.key
-rw-r--r-- 1 root root 1708 Aug 31 09:20 /etc/pki/tls/private/logstash-forwarder.key
[yinzhengjie@s101 ~]$ 

2>.创建filter配置文件“10-syslog-filter.conf”

[yinzhengjie@s101 ~]$ sudo vi /etc/logstash/conf.d/10-syslog-filter.conf
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/logstash/conf.d/10-syslog-filter.conf
filter {
  if [type] == "syslog" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}" }
      add_field => [ "received_at", "%{@timestamp}" ]
      add_field => [ "received_from", "%{host}" ]
    }
    syslog_pri { }
    date {
      match => [ "syslog_timestamp", "MMM  d HH:mm:ss", "MMM dd HH:mm:ss" ]
    }
  }
}
[yinzhengjie@s101 ~]$ 

3>.创建output配置文件“30-elasticsearch-output.conf”

[yinzhengjie@s101 ~]$ sudo vi /etc/logstash/conf.d/30-elasticsearch-output.conf
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ more /etc/logstash/conf.d/30-elasticsearch-output.conf
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    sniffing => true
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}
[yinzhengjie@s101 ~]$

4>.测试logstash配置

[yinzhengjie@s101 ~]$ sudo service logstash configtest
Configuration OK
[yinzhengjie@s101 ~]$ 

  如果测试配置报错如下:

[yinzhengjie@s101 ~]$ sudo service logstash configtest
[sudo] password for yinzhengjie: 
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 

  根据报错他找不到Java的环境变量,这个时候我们需要重写安装一下Java的1.8版本即可。如果你不知道java1.8的包名的话可以先搜一下包含jdk的包

[yinzhengjie@s101 ~]$ yum search jdk
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * epel: mirror.premi.st
 * extras: mirrors.aliyun.com
 * updates: mirrors.huaweicloud.com
epel                                                                                                                                                                       12662/12662
logstash-2.2                                                                                                                                                                       5/5
================================================================================== N/S matched: jdk ===================================================================================
copy-jdk-configs.noarch : JDKs configuration files copier
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-accessibility.x86_64 : OpenJDK accessibility connector
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-headless.x86_64 : The OpenJDK runtime environment without audio and video support
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.i686 : OpenJDK Runtime Environment
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-accessibility.i686 : OpenJDK accessibility connector
java-1.8.0-openjdk-accessibility.x86_64 : OpenJDK accessibility connector
java-1.8.0-openjdk-accessibility-debug.i686 : OpenJDK accessibility connector for packages with debug on
java-1.8.0-openjdk-accessibility-debug.x86_64 : OpenJDK accessibility connector for packages with debug on
java-1.8.0-openjdk-debug.i686 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-demo.i686 : OpenJDK Demos
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-demo-debug.i686 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-demo-debug.x86_64 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-devel.i686 : OpenJDK Development Environment
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.i686 : OpenJDK Development Environment with full debug on
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with full debug on
java-1.8.0-openjdk-headless.i686 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless-debug.i686 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK API Documentation for packages with debug on
java-1.8.0-openjdk-javadoc-zip.noarch : OpenJDK API Documentation compressed in single archive
java-1.8.0-openjdk-javadoc-zip-debug.noarch : OpenJDK API Documentation compressed in single archive for packages with debug on
java-1.8.0-openjdk-src.i686 : OpenJDK Source Bundle
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk-src-debug.i686 : OpenJDK Source Bundle for packages with debug on
java-1.8.0-openjdk-src-debug.x86_64 : OpenJDK Source Bundle for packages with debug on
ldapjdk-javadoc.noarch : Javadoc for ldapjdk
icedtea-web.x86_64 : Additional Java components for OpenJDK - Java browser plug-in and Web Start implementation
ldapjdk.noarch : The Mozilla LDAP Java SDK
openprops.noarch : An improved java.util.Properties from OpenJDK

  Name and summary matches only, use "search all" for everything.
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ yum search jdk
[yinzhengjie@s101 ~]$ sudo yum -y install java-1.8.0-openjdk.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5 will be installed
--> Processing Dependency: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.181-3.b13.el7_5 for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libjvm.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libjvm.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libjava.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libXrender.so.1()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libXi.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: libXcomposite.so.1()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
--> Running transaction check
---> Package giflib.x86_64 0:4.1.6-9.el7 will be installed
--> Processing Dependency: libSM.so.6()(64bit) for package: giflib-4.1.6-9.el7.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: giflib-4.1.6-9.el7.x86_64
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5 will be installed
--> Processing Dependency: tzdata-java >= 2015d for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: nss-softokn(x86-64) >= 3.36.0 for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: nss(x86-64) >= 3.36.0 for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: copy-jdk-configs >= 2.2 for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: chkconfig >= 1.7 for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: chkconfig >= 1.7 for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: lksctp-tools(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
--> Processing Dependency: jpackage-utils for package: 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64
---> Package libXcomposite.x86_64 0:0.4.4-4.1.el7 will be installed
---> Package libXext.x86_64 0:1.3.3-3.el7 will be installed
---> Package libXi.x86_64 0:1.7.9-1.el7 will be installed
---> Package libXrender.x86_64 0:0.9.10-1.el7 will be installed
---> Package libXtst.x86_64 0:1.2.3-1.el7 will be installed
---> Package xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 will be installed
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
--> Running transaction check
---> Package chkconfig.x86_64 0:1.3.61-5.el7 will be updated
---> Package chkconfig.x86_64 0:1.7.4-1.el7 will be an update
---> Package copy-jdk-configs.noarch 0:3.3-10.el7_5 will be installed
---> Package javapackages-tools.noarch 0:3.4.1-11.el7 will be installed
--> Processing Dependency: python-javapackages = 3.4.1-11.el7 for package: javapackages-tools-3.4.1-11.el7.noarch
---> Package libICE.x86_64 0:1.0.9-9.el7 will be installed
---> Package libSM.x86_64 0:1.2.2-2.el7 will be installed
---> Package lksctp-tools.x86_64 0:1.0.17-2.el7 will be installed
---> Package nss.x86_64 0:3.19.1-18.el7 will be updated
--> Processing Dependency: nss = 3.19.1-18.el7 for package: nss-sysinit-3.19.1-18.el7.x86_64
--> Processing Dependency: nss(x86-64) = 3.19.1-18.el7 for package: nss-tools-3.19.1-18.el7.x86_64
---> Package nss.x86_64 0:3.36.0-5.el7_5 will be an update
--> Processing Dependency: nss-util >= 3.36.0-1 for package: nss-3.36.0-5.el7_5.x86_64
--> Processing Dependency: nspr >= 4.19.0 for package: nss-3.36.0-5.el7_5.x86_64
--> Processing Dependency: nss-pem(x86-64) for package: nss-3.36.0-5.el7_5.x86_64
--> Processing Dependency: libnssutil3.so(NSSUTIL_3.31)(64bit) for package: nss-3.36.0-5.el7_5.x86_64
--> Processing Dependency: libnssutil3.so(NSSUTIL_3.24)(64bit) for package: nss-3.36.0-5.el7_5.x86_64
--> Processing Dependency: libnssutil3.so(NSSUTIL_3.21)(64bit) for package: nss-3.36.0-5.el7_5.x86_64
---> Package nss-softokn.x86_64 0:3.16.2.3-13.el7_1 will be updated
---> Package nss-softokn.x86_64 0:3.36.0-5.el7_5 will be an update
--> Processing Dependency: nss-softokn-freebl(x86-64) >= 3.36.0-5.el7_5 for package: nss-softokn-3.36.0-5.el7_5.x86_64
---> Package ttmkfdir.x86_64 0:3.0.9-42.el7 will be installed
---> Package tzdata-java.noarch 0:2018e-3.el7 will be installed
---> Package xorg-x11-font-utils.x86_64 1:7.5-20.el7 will be installed
--> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-20.el7.x86_64
--> Processing Dependency: libXfont.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-20.el7.x86_64
--> Running transaction check
---> Package libXfont.x86_64 0:1.5.2-1.el7 will be installed
---> Package libfontenc.x86_64 0:1.1.3-3.el7 will be installed
---> Package nspr.x86_64 0:4.10.8-2.el7_1 will be updated
---> Package nspr.x86_64 0:4.19.0-1.el7_5 will be an update
---> Package nss-pem.x86_64 0:1.0.3-4.el7 will be installed
---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-13.el7_1 will be updated
---> Package nss-softokn-freebl.x86_64 0:3.36.0-5.el7_5 will be an update
---> Package nss-sysinit.x86_64 0:3.19.1-18.el7 will be updated
---> Package nss-sysinit.x86_64 0:3.36.0-5.el7_5 will be an update
---> Package nss-tools.x86_64 0:3.19.1-18.el7 will be updated
---> Package nss-tools.x86_64 0:3.36.0-5.el7_5 will be an update
---> Package nss-util.x86_64 0:3.19.1-4.el7_1 will be updated
---> Package nss-util.x86_64 0:3.36.0-1.el7_5 will be an update
---> Package python-javapackages.noarch 0:3.4.1-11.el7 will be installed
--> Processing Dependency: python-lxml for package: python-javapackages-3.4.1-11.el7.noarch
--> Running transaction check
---> Package python-lxml.x86_64 0:3.2.1-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                                Arch                              Version                                             Repository                          Size
=======================================================================================================================================================================================
Installing:
 java-1.8.0-openjdk                                     x86_64                            1:1.8.0.181-3.b13.el7_5                             updates                            250 k
Installing for dependencies:
 copy-jdk-configs                                       noarch                            3.3-10.el7_5                                        updates                             21 k
 giflib                                                 x86_64                            4.1.6-9.el7                                         base                                40 k
 java-1.8.0-openjdk-headless                            x86_64                            1:1.8.0.181-3.b13.el7_5                             updates                             32 M
 javapackages-tools                                     noarch                            3.4.1-11.el7                                        base                                73 k
 libICE                                                 x86_64                            1.0.9-9.el7                                         base                                66 k
 libSM                                                  x86_64                            1.2.2-2.el7                                         base                                39 k
 libXcomposite                                          x86_64                            0.4.4-4.1.el7                                       base                                22 k
 libXext                                                x86_64                            1.3.3-3.el7                                         base                                39 k
 libXfont                                               x86_64                            1.5.2-1.el7                                         base                               152 k
 libXi                                                  x86_64                            1.7.9-1.el7                                         base                                40 k
 libXrender                                             x86_64                            0.9.10-1.el7                                        base                                26 k
 libXtst                                                x86_64                            1.2.3-1.el7                                         base                                20 k
 libfontenc                                             x86_64                            1.1.3-3.el7                                         base                                31 k
 lksctp-tools                                           x86_64                            1.0.17-2.el7                                        base                                88 k
 nss-pem                                                x86_64                            1.0.3-4.el7                                         base                                73 k
 python-javapackages                                    noarch                            3.4.1-11.el7                                        base                                31 k
 python-lxml                                            x86_64                            3.2.1-4.el7                                         base                               758 k
 ttmkfdir                                               x86_64                            3.0.9-42.el7                                        base                                48 k
 tzdata-java                                            noarch                            2018e-3.el7                                         updates                            185 k
 xorg-x11-font-utils                                    x86_64                            1:7.5-20.el7                                        base                                87 k
 xorg-x11-fonts-Type1                                   noarch                            7.5-9.el7                                           base                               521 k
Updating for dependencies:
 chkconfig                                              x86_64                            1.7.4-1.el7                                         base                               181 k
 nspr                                                   x86_64                            4.19.0-1.el7_5                                      updates                            127 k
 nss                                                    x86_64                            3.36.0-5.el7_5                                      updates                            835 k
 nss-softokn                                            x86_64                            3.36.0-5.el7_5                                      updates                            315 k
 nss-softokn-freebl                                     x86_64                            3.36.0-5.el7_5                                      updates                            222 k
 nss-sysinit                                            x86_64                            3.36.0-5.el7_5                                      updates                             62 k
 nss-tools                                              x86_64                            3.36.0-5.el7_5                                      updates                            514 k
 nss-util                                               x86_64                            3.36.0-1.el7_5                                      updates                             78 k

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package  (+21 Dependent packages)
Upgrade             (  8 Dependent packages)

Total download size: 37 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/30): chkconfig-1.7.4-1.el7.x86_64.rpm                                                                                                                        | 181 kB  00:00:02     
(2/30): javapackages-tools-3.4.1-11.el7.noarch.rpm                                                                                                              |  73 kB  00:00:00     
(3/30): libICE-1.0.9-9.el7.x86_64.rpm                                                                                                                           |  66 kB  00:00:00     
(4/30): libSM-1.2.2-2.el7.x86_64.rpm                                                                                                                            |  39 kB  00:00:00     
(5/30): libXcomposite-0.4.4-4.1.el7.x86_64.rpm                                                                                                                  |  22 kB  00:00:00     
(6/30): libXext-1.3.3-3.el7.x86_64.rpm                                                                                                                          |  39 kB  00:00:00     
(7/30): libXfont-1.5.2-1.el7.x86_64.rpm                                                                                                                         | 152 kB  00:00:00     
(8/30): libXi-1.7.9-1.el7.x86_64.rpm                                                                                                                            |  40 kB  00:00:00     
(9/30): libXrender-0.9.10-1.el7.x86_64.rpm                                                                                                                      |  26 kB  00:00:00     
(10/30): libXtst-1.2.3-1.el7.x86_64.rpm                                                                                                                         |  20 kB  00:00:00     
(11/30): libfontenc-1.1.3-3.el7.x86_64.rpm                                                                                                                      |  31 kB  00:00:00     
(12/30): lksctp-tools-1.0.17-2.el7.x86_64.rpm                                                                                                                   |  88 kB  00:00:00     
(13/30): java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64.rpm                                                                                                    | 250 kB  00:00:04     
(14/30): nss-3.36.0-5.el7_5.x86_64.rpm                                                                                                                          | 835 kB  00:00:00     
(15/30): nss-pem-1.0.3-4.el7.x86_64.rpm                                                                                                                         |  73 kB  00:00:00     
(16/30): nss-softokn-3.36.0-5.el7_5.x86_64.rpm                                                                                                                  | 315 kB  00:00:00     
(17/30): copy-jdk-configs-3.3-10.el7_5.noarch.rpm                                                                                                               |  21 kB  00:00:05     
(18/30): giflib-4.1.6-9.el7.x86_64.rpm                                                                                                                          |  40 kB  00:00:05     
(19/30): nss-sysinit-3.36.0-5.el7_5.x86_64.rpm                                                                                                                  |  62 kB  00:00:00     
(20/30): nss-softokn-freebl-3.36.0-5.el7_5.x86_64.rpm                                                                                                           | 222 kB  00:00:00     
(21/30): nss-util-3.36.0-1.el7_5.x86_64.rpm                                                                                                                     |  78 kB  00:00:00     
(22/30): python-javapackages-3.4.1-11.el7.noarch.rpm                                                                                                            |  31 kB  00:00:00     
(23/30): ttmkfdir-3.0.9-42.el7.x86_64.rpm                                                                                                                       |  48 kB  00:00:00     
(24/30): tzdata-java-2018e-3.el7.noarch.rpm                                                                                                                     | 185 kB  00:00:00     
(25/30): python-lxml-3.2.1-4.el7.x86_64.rpm                                                                                                                     | 758 kB  00:00:00     
(26/30): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm                                                                                                              |  87 kB  00:00:00     
(27/30): nss-tools-3.36.0-5.el7_5.x86_64.rpm                                                                                                                    | 514 kB  00:00:00     
(28/30): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm                                                                                                              | 521 kB  00:00:00     
(29/30): java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64.rpm                                                                                           |  32 MB  00:00:13     
(30/30): nspr-4.19.0-1.el7_5.x86_64.rpm                                                                                                                         | 127 kB  00:00:15     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                  1.9 MB/s |  37 MB  00:00:19     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : nspr-4.19.0-1.el7_5.x86_64                                                                                                                                         1/38 
  Updating   : nss-util-3.36.0-1.el7_5.x86_64                                                                                                                                     2/38 
  Installing : libXext-1.3.3-3.el7.x86_64                                                                                                                                         3/38 
  Installing : libXi-1.7.9-1.el7.x86_64                                                                                                                                           4/38 
  Installing : libfontenc-1.1.3-3.el7.x86_64                                                                                                                                      5/38 
  Updating   : chkconfig-1.7.4-1.el7.x86_64                                                                                                                                       6/38 
  Installing : libICE-1.0.9-9.el7.x86_64                                                                                                                                          7/38 
  Installing : libSM-1.2.2-2.el7.x86_64                                                                                                                                           8/38 
  Installing : giflib-4.1.6-9.el7.x86_64                                                                                                                                          9/38 
  Installing : libXfont-1.5.2-1.el7.x86_64                                                                                                                                       10/38 
  Installing : 1:xorg-x11-font-utils-7.5-20.el7.x86_64                                                                                                                           11/38 
  Installing : libXtst-1.2.3-1.el7.x86_64                                                                                                                                        12/38 
  Updating   : nss-softokn-freebl-3.36.0-5.el7_5.x86_64                                                                                                                          13/38 
  Updating   : nss-softokn-3.36.0-5.el7_5.x86_64                                                                                                                                 14/38 
  Updating   : nss-sysinit-3.36.0-5.el7_5.x86_64                                                                                                                                 15/38 
  Updating   : nss-3.36.0-5.el7_5.x86_64                                                                                                                                         16/38 
  Installing : nss-pem-1.0.3-4.el7.x86_64                                                                                                                                        17/38 
  Installing : tzdata-java-2018e-3.el7.noarch                                                                                                                                    18/38 
  Installing : lksctp-tools-1.0.17-2.el7.x86_64                                                                                                                                  19/38 
  Installing : libXcomposite-0.4.4-4.1.el7.x86_64                                                                                                                                20/38 
  Installing : copy-jdk-configs-3.3-10.el7_5.noarch                                                                                                                              21/38 
  Installing : ttmkfdir-3.0.9-42.el7.x86_64                                                                                                                                      22/38 
  Installing : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                                                             23/38 
  Installing : python-lxml-3.2.1-4.el7.x86_64                                                                                                                                    24/38 
  Installing : python-javapackages-3.4.1-11.el7.noarch                                                                                                                           25/38 
  Installing : javapackages-tools-3.4.1-11.el7.noarch                                                                                                                            26/38 
  Installing : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64                                                                                                        27/38 
  Installing : libXrender-0.9.10-1.el7.x86_64                                                                                                                                    28/38 
  Installing : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64                                                                                                                 29/38 
  Updating   : nss-tools-3.36.0-5.el7_5.x86_64                                                                                                                                   30/38 
  Cleanup    : nss-tools-3.19.1-18.el7.x86_64                                                                                                                                    31/38 
  Cleanup    : nss-sysinit-3.19.1-18.el7.x86_64                                                                                                                                  32/38 
  Cleanup    : nss-3.19.1-18.el7.x86_64                                                                                                                                          33/38 
  Cleanup    : nss-softokn-3.16.2.3-13.el7_1.x86_64                                                                                                                              34/38 
  Cleanup    : nss-util-3.19.1-4.el7_1.x86_64                                                                                                                                    35/38 
  Cleanup    : nspr-4.10.8-2.el7_1.x86_64                                                                                                                                        36/38 
  Cleanup    : nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64                                                                                                                       37/38 
  Cleanup    : chkconfig-1.3.61-5.el7.x86_64                                                                                                                                     38/38 
  Verifying  : libXext-1.3.3-3.el7.x86_64                                                                                                                                         1/38 
  Verifying  : libXi-1.7.9-1.el7.x86_64                                                                                                                                           2/38 
  Verifying  : libICE-1.0.9-9.el7.x86_64                                                                                                                                          3/38 
  Verifying  : giflib-4.1.6-9.el7.x86_64                                                                                                                                          4/38 
  Verifying  : nss-pem-1.0.3-4.el7.x86_64                                                                                                                                         5/38 
  Verifying  : libXrender-0.9.10-1.el7.x86_64                                                                                                                                     6/38 
  Verifying  : nss-tools-3.36.0-5.el7_5.x86_64                                                                                                                                    7/38 
  Verifying  : libXfont-1.5.2-1.el7.x86_64                                                                                                                                        8/38 
  Verifying  : python-lxml-3.2.1-4.el7.x86_64                                                                                                                                     9/38 
  Verifying  : ttmkfdir-3.0.9-42.el7.x86_64                                                                                                                                      10/38 
  Verifying  : nss-util-3.36.0-1.el7_5.x86_64                                                                                                                                    11/38 
  Verifying  : copy-jdk-configs-3.3-10.el7_5.noarch                                                                                                                              12/38 
  Verifying  : python-javapackages-3.4.1-11.el7.noarch                                                                                                                           13/38 
  Verifying  : libXcomposite-0.4.4-4.1.el7.x86_64                                                                                                                                14/38 
  Verifying  : libXtst-1.2.3-1.el7.x86_64                                                                                                                                        15/38 
  Verifying  : lksctp-tools-1.0.17-2.el7.x86_64                                                                                                                                  16/38 
  Verifying  : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64                                                                                                                 17/38 
  Verifying  : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_64                                                                                                        18/38 
  Verifying  : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                                                             19/38 
  Verifying  : javapackages-tools-3.4.1-11.el7.noarch                                                                                                                            20/38 
  Verifying  : nss-softokn-freebl-3.36.0-5.el7_5.x86_64                                                                                                                          21/38 
  Verifying  : libSM-1.2.2-2.el7.x86_64                                                                                                                                          22/38 
  Verifying  : nspr-4.19.0-1.el7_5.x86_64                                                                                                                                        23/38 
  Verifying  : tzdata-java-2018e-3.el7.noarch                                                                                                                                    24/38 
  Verifying  : nss-3.36.0-5.el7_5.x86_64                                                                                                                                         25/38 
  Verifying  : chkconfig-1.7.4-1.el7.x86_64                                                                                                                                      26/38 
  Verifying  : libfontenc-1.1.3-3.el7.x86_64                                                                                                                                     27/38 
  Verifying  : nss-softokn-3.36.0-5.el7_5.x86_64                                                                                                                                 28/38 
  Verifying  : nss-sysinit-3.36.0-5.el7_5.x86_64                                                                                                                                 29/38 
  Verifying  : 1:xorg-x11-font-utils-7.5-20.el7.x86_64                                                                                                                           30/38 
  Verifying  : nss-tools-3.19.1-18.el7.x86_64                                                                                                                                    31/38 
  Verifying  : nss-softokn-3.16.2.3-13.el7_1.x86_64                                                                                                                              32/38 
  Verifying  : nss-3.19.1-18.el7.x86_64                                                                                                                                          33/38 
  Verifying  : nss-sysinit-3.19.1-18.el7.x86_64                                                                                                                                  34/38 
  Verifying  : chkconfig-1.3.61-5.el7.x86_64                                                                                                                                     35/38 
  Verifying  : nss-util-3.19.1-4.el7_1.x86_64                                                                                                                                    36/38 
  Verifying  : nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64                                                                                                                       37/38 
  Verifying  : nspr-4.10.8-2.el7_1.x86_64                                                                                                                                        38/38 

Installed:
  java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5                                                                                                                                    

Dependency Installed:
  copy-jdk-configs.noarch 0:3.3-10.el7_5   giflib.x86_64 0:4.1.6-9.el7         java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5  javapackages-tools.noarch 0:3.4.1-11.el7  
  libICE.x86_64 0:1.0.9-9.el7              libSM.x86_64 0:1.2.2-2.el7          libXcomposite.x86_64 0:0.4.4-4.1.el7                        libXext.x86_64 0:1.3.3-3.el7              
  libXfont.x86_64 0:1.5.2-1.el7            libXi.x86_64 0:1.7.9-1.el7          libXrender.x86_64 0:0.9.10-1.el7                            libXtst.x86_64 0:1.2.3-1.el7              
  libfontenc.x86_64 0:1.1.3-3.el7          lksctp-tools.x86_64 0:1.0.17-2.el7  nss-pem.x86_64 0:1.0.3-4.el7                                python-javapackages.noarch 0:3.4.1-11.el7 
  python-lxml.x86_64 0:3.2.1-4.el7         ttmkfdir.x86_64 0:3.0.9-42.el7      tzdata-java.noarch 0:2018e-3.el7                            xorg-x11-font-utils.x86_64 1:7.5-20.el7   
  xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 

Dependency Updated:
  chkconfig.x86_64 0:1.7.4-1.el7                     nspr.x86_64 0:4.19.0-1.el7_5                nss.x86_64 0:3.36.0-5.el7_5               nss-softokn.x86_64 0:3.36.0-5.el7_5        
  nss-softokn-freebl.x86_64 0:3.36.0-5.el7_5         nss-sysinit.x86_64 0:3.36.0-5.el7_5         nss-tools.x86_64 0:3.36.0-5.el7_5         nss-util.x86_64 0:3.36.0-1.el7_5           

Complete!
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo yum -y install java-1.8.0-openjdk.x86_64

5>.重启logstash并使配置生效

[yinzhengjie@s101 ~]$ sudo systemctl start logstash        #启动logstash
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ sudo chkconfig logstash on                                #设置开机自启
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ps -ef | grep logstash
logstash   5557      1 35 09:58 ?        00:00:15 /bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/var/lib/logstash -Xmx1g -Xss2048k -Djffi.boot.library.path=/opt/logstash/vendor/jruby/lib/jni -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/var/lib/logstash -XX:HeapDumpPath=/opt/logstash/heapdump.hprof -Xbootclasspath/a:/opt/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/opt/logstash/vendor/jruby -Djruby.lib=/opt/logstas/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
yinzhen+   5622   2281  0 09:59 pts/0    00:00:00 grep --color=auto logstash
[yinzhengjie@s101 ~]$ 

七.加载Kibana的仪表盘

1>.下载仪表盘样例归档文件

[yinzhengjie@s101 ~]$ cd download/
[yinzhengjie@s101 download]$ ll
total 622512
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ curl -L -O https://download.elastic.co/beats/dashboards/beats-dashboards-1.2.2.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  890k  100  890k    0     0   129k      0  0:00:06  0:00:06 --:--:--  183k
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ ll
total 623404
-rw-rw-r--  1 yinzhengjie yinzhengjie    912168 Aug 31 10:04 beats-dashboards-1.2.2.zip
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ 

2>.安装zip的解压包

[yinzhengjie@s101 download]$ sudo yum -y install unzip
[sudo] password for yinzhengjie: 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package unzip.x86_64 0:6.0-19.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                   Arch                                       Version                                           Repository                                Size
=======================================================================================================================================================================================
Installing:
 unzip                                     x86_64                                     6.0-19.el7                                        base                                     170 k

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 170 k
Installed size: 365 k
Downloading packages:
unzip-6.0-19.el7.x86_64.rpm                                                                                                                                     | 170 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : unzip-6.0-19.el7.x86_64                                                                                                                                             1/1 
  Verifying  : unzip-6.0-19.el7.x86_64                                                                                                                                             1/1 

Installed:
  unzip.x86_64 0:6.0-19.el7                                                                                                                                                            

Complete!
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ sudo yum -y install unzip

3>.加压下载后的软件包(“beats-dashboards-1.2.2.zip”

[yinzhengjie@s101 download]$ ll
total 623404
-rw-rw-r--  1 yinzhengjie yinzhengjie    912168 Aug 31 10:04 beats-dashboards-1.2.2.zip
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ unzip beats-dashboards-1.2.2.zip 
Archive:  beats-dashboards-1.2.2.zip
670cd5d9d5911a4cbaf800a51935c76d8ce7076c
   creating: beats-dashboards-1.2.2/
 extracting: beats-dashboards-1.2.2/.gitignore  
  inflating: beats-dashboards-1.2.2/CHANGELOG.md  
  inflating: beats-dashboards-1.2.2/Makefile  
  inflating: beats-dashboards-1.2.2/README.md  
   creating: beats-dashboards-1.2.2/dashboards/
   creating: beats-dashboards-1.2.2/dashboards/dashboard/
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/HTTP.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/MongoDB-performance.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/MySQL-performance.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/Packetbeat-Dashboard.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/PgSQL-performance.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/Thrift-performance.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/Topbeat-Dashboard.json  
  inflating: beats-dashboards-1.2.2/dashboards/dashboard/Winlogbeat-Dashboard.json  
   creating: beats-dashboards-1.2.2/dashboards/index-pattern/
  inflating: beats-dashboards-1.2.2/dashboards/index-pattern/filebeat.json  
  inflating: beats-dashboards-1.2.2/dashboards/index-pattern/packetbeat.json  
  inflating: beats-dashboards-1.2.2/dashboards/index-pattern/topbeat.json  
  inflating: beats-dashboards-1.2.2/dashboards/index-pattern/winlogbeat.json  
   creating: beats-dashboards-1.2.2/dashboards/search/
  inflating: beats-dashboards-1.2.2/dashboards/search/Cache-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/DB-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Default-Search.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Filesystem-stats.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/HTTP-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/MongoDB-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/MongoDB-transactions-with-write-concern-0.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/MongoDB-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/MySQL-Transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/MySQL-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Packetbeat-Search.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/PgSQL-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/PgSQL-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Proc-stats.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Processes.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/RPC-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/System-stats.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/System-wide.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Thrift-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Thrift-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Web-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/search/Winlogbeat-Search.json  
   creating: beats-dashboards-1.2.2/dashboards/visualization/
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Average-system-load-across-all-systems.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/CPU-usage-per-process.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/CPU-usage.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Cache-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Client-locations.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/DB-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Disk-usage-overview.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Disk-usage.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Disk-utilization-over-time.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Errors-count-over-time.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Errors-vs-successful-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Event-Levels.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Evolution-of-the-CPU-times-per-process.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/HTTP-codes-for-the-top-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/HTTP-error-codes-evolution.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/HTTP-error-codes.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Latency-histogram.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Levels.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Memory-usage-per-process.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Memory-usage.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-commands.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-errors-per-collection.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-in-slash-out-throughput.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-response-times-and-count.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MongoDB-response-times-by-collection.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Most-frequent-MySQL-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Most-frequent-PgSQL-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MySQL-Errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MySQL-Methods.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MySQL-Reads-vs-Writes.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/MySQL-throughput.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Mysql-response-times-percentiles.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Navigation.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Number-of-Events-Over-Time-By-Event-Log.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Number-of-Events.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Number-of-MongoDB-transactions-with-writeConcern-w-equal-0.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/PgSQL-Errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/PgSQL-Methods.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/PgSQL-Reads-vs-Writes.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/PgSQL-response-times-percentiles.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/PgSQL-throughput.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Process-status.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/RPC-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Reads-versus-Writes.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Response-times-percentiles.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Response-times-repartition.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Servers.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Slowest-MySQL-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Slowest-PgSQL-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Slowest-Thrift-RPC-methods.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Sources.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/System-load.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Thrift-RPC-Errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Thrift-requests-per-minute.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Thrift-response-times-percentiles.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-10-HTTP-requests.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-10-memory-consumers.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-10-processes-by-total-CPU-usage.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-Event-IDs.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-Thrift-RPC-calls-with-errors.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-Thrift-RPC-methods.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-processes.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Top-slowest-MongoDB-queries.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Total-number-of-HTTP-transactions.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Total-time-spent-in-each-MongoDB-collection.json  
  inflating: beats-dashboards-1.2.2/dashboards/visualization/Web-transactions.json  
  inflating: beats-dashboards-1.2.2/load.ps1  
  inflating: beats-dashboards-1.2.2/load.sh  
   creating: beats-dashboards-1.2.2/save/
  inflating: beats-dashboards-1.2.2/save/README.md  
  inflating: beats-dashboards-1.2.2/save/kibana_dump.py  
 extracting: beats-dashboards-1.2.2/save/requirements.txt  
   creating: beats-dashboards-1.2.2/screenshots/
  inflating: beats-dashboards-1.2.2/screenshots/MySql-performance.png  
  inflating: beats-dashboards-1.2.2/screenshots/Packetbeat-statistics.png  
  inflating: beats-dashboards-1.2.2/screenshots/PgSql-performance.png  
  inflating: beats-dashboards-1.2.2/screenshots/Thrift-performance.png  
  inflating: beats-dashboards-1.2.2/screenshots/Topbeat-statistics.png  
  inflating: beats-dashboards-1.2.2/screenshots/winlogbeat-dashboard.png  
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ unzip beats-dashboards-1.2.2.zip

4>.进入解压目录,执行load.sh脚本

[yinzhengjie@s101 download]$ ll
total 623404
drwxrwxr-x  5 yinzhengjie yinzhengjie       148 Mar 24  2016 beats-dashboards-1.2.2
-rw-rw-r--  1 yinzhengjie yinzhengjie    912168 Aug 31 10:04 beats-dashboards-1.2.2.zip
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ cd beats-dashboards-1.2.2
[yinzhengjie@s101 beats-dashboards-1.2.2]$ ./load.sh 
Loading dashboards to http://localhost:9200 in .kibana
{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"already exists","index":".kibana"}],"type":"index_already_exists_exception","reason":"already exists","index":".kibana"},"status":400}{"acknowledged":true}Loading search Cache-transactions:
{"_index":".kibana","_type":"search","_id":"Cache-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search DB-transactions:
{"_index":".kibana","_type":"search","_id":"DB-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Default-Search:
{"_index":".kibana","_type":"search","_id":"Default-Search","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Errors:
{"_index":".kibana","_type":"search","_id":"Errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Filesystem-stats:
{"_index":".kibana","_type":"search","_id":"Filesystem-stats","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search HTTP-errors:
{"_index":".kibana","_type":"search","_id":"HTTP-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search MongoDB-errors:
{"_index":".kibana","_type":"search","_id":"MongoDB-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search MongoDB-transactions:
{"_index":".kibana","_type":"search","_id":"MongoDB-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search MongoDB-transactions-with-write-concern-0:
{"_index":".kibana","_type":"search","_id":"MongoDB-transactions-with-write-concern-0","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search MySQL-errors:
{"_index":".kibana","_type":"search","_id":"MySQL-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search MySQL-Transactions:
{"_index":".kibana","_type":"search","_id":"MySQL-Transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Packetbeat-Search:
{"_index":".kibana","_type":"search","_id":"Packetbeat-Search","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search PgSQL-errors:
{"_index":".kibana","_type":"search","_id":"PgSQL-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search PgSQL-transactions:
{"_index":".kibana","_type":"search","_id":"PgSQL-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Processes:
{"_index":".kibana","_type":"search","_id":"Processes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Proc-stats:
{"_index":".kibana","_type":"search","_id":"Proc-stats","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search RPC-transactions:
{"_index":".kibana","_type":"search","_id":"RPC-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search System-stats:
{"_index":".kibana","_type":"search","_id":"System-stats","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search System-wide:
{"_index":".kibana","_type":"search","_id":"System-wide","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Thrift-errors:
{"_index":".kibana","_type":"search","_id":"Thrift-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Thrift-transactions:
{"_index":".kibana","_type":"search","_id":"Thrift-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Web-transactions:
{"_index":".kibana","_type":"search","_id":"Web-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading search Winlogbeat-Search:
{"_index":".kibana","_type":"search","_id":"Winlogbeat-Search","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Average-system-load-across-all-systems:
{"_index":".kibana","_type":"visualization","_id":"Average-system-load-across-all-systems","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Cache-transactions:
{"_index":".kibana","_type":"visualization","_id":"Cache-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Client-locations:
{"_index":".kibana","_type":"visualization","_id":"Client-locations","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization CPU-usage:
{"_index":".kibana","_type":"visualization","_id":"CPU-usage","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization CPU-usage-per-process:
{"_index":".kibana","_type":"visualization","_id":"CPU-usage-per-process","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization DB-transactions:
{"_index":".kibana","_type":"visualization","_id":"DB-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Disk-usage:
{"_index":".kibana","_type":"visualization","_id":"Disk-usage","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Disk-usage-overview:
{"_index":".kibana","_type":"visualization","_id":"Disk-usage-overview","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Disk-utilization-over-time:
{"_index":".kibana","_type":"visualization","_id":"Disk-utilization-over-time","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Errors-count-over-time:
{"_index":".kibana","_type":"visualization","_id":"Errors-count-over-time","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Errors-vs-successful-transactions:
{"_index":".kibana","_type":"visualization","_id":"Errors-vs-successful-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Event-Levels:
{"_index":".kibana","_type":"visualization","_id":"Event-Levels","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Evolution-of-the-CPU-times-per-process:
{"_index":".kibana","_type":"visualization","_id":"Evolution-of-the-CPU-times-per-process","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization HTTP-codes-for-the-top-queries:
{"_index":".kibana","_type":"visualization","_id":"HTTP-codes-for-the-top-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization HTTP-error-codes-evolution:
{"_index":".kibana","_type":"visualization","_id":"HTTP-error-codes-evolution","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization HTTP-error-codes:
{"_index":".kibana","_type":"visualization","_id":"HTTP-error-codes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Latency-histogram:
{"_index":".kibana","_type":"visualization","_id":"Latency-histogram","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Levels:
{"_index":".kibana","_type":"visualization","_id":"Levels","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Memory-usage:
{"_index":".kibana","_type":"visualization","_id":"Memory-usage","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Memory-usage-per-process:
{"_index":".kibana","_type":"visualization","_id":"Memory-usage-per-process","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-commands:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-commands","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-errors:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-errors-per-collection:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-errors-per-collection","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-in-slash-out-throughput:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-in-slash-out-throughput","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-response-times-and-count:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-response-times-and-count","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MongoDB-response-times-by-collection:
{"_index":".kibana","_type":"visualization","_id":"MongoDB-response-times-by-collection","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Most-frequent-MySQL-queries:
{"_index":".kibana","_type":"visualization","_id":"Most-frequent-MySQL-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Most-frequent-PgSQL-queries:
{"_index":".kibana","_type":"visualization","_id":"Most-frequent-PgSQL-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MySQL-Errors:
{"_index":".kibana","_type":"visualization","_id":"MySQL-Errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MySQL-Methods:
{"_index":".kibana","_type":"visualization","_id":"MySQL-Methods","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MySQL-Reads-vs-Writes:
{"_index":".kibana","_type":"visualization","_id":"MySQL-Reads-vs-Writes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Mysql-response-times-percentiles:
{"_index":".kibana","_type":"visualization","_id":"Mysql-response-times-percentiles","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization MySQL-throughput:
{"_index":".kibana","_type":"visualization","_id":"MySQL-throughput","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Navigation:
{"_index":".kibana","_type":"visualization","_id":"Navigation","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Number-of-Events:
{"_index":".kibana","_type":"visualization","_id":"Number-of-Events","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Number-of-Events-Over-Time-By-Event-Log:
{"_index":".kibana","_type":"visualization","_id":"Number-of-Events-Over-Time-By-Event-Log","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Number-of-MongoDB-transactions-with-writeConcern-w-equal-0:
{"_index":".kibana","_type":"visualization","_id":"Number-of-MongoDB-transactions-with-writeConcern-w-equal-0","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization PgSQL-Errors:
{"_index":".kibana","_type":"visualization","_id":"PgSQL-Errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization PgSQL-Methods:
{"_index":".kibana","_type":"visualization","_id":"PgSQL-Methods","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization PgSQL-Reads-vs-Writes:
{"_index":".kibana","_type":"visualization","_id":"PgSQL-Reads-vs-Writes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization PgSQL-response-times-percentiles:
{"_index":".kibana","_type":"visualization","_id":"PgSQL-response-times-percentiles","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization PgSQL-throughput:
{"_index":".kibana","_type":"visualization","_id":"PgSQL-throughput","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Process-status:
{"_index":".kibana","_type":"visualization","_id":"Process-status","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Reads-versus-Writes:
{"_index":".kibana","_type":"visualization","_id":"Reads-versus-Writes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Response-times-percentiles:
{"_index":".kibana","_type":"visualization","_id":"Response-times-percentiles","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Response-times-repartition:
{"_index":".kibana","_type":"visualization","_id":"Response-times-repartition","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization RPC-transactions:
{"_index":".kibana","_type":"visualization","_id":"RPC-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Servers:
{"_index":".kibana","_type":"visualization","_id":"Servers","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Slowest-MySQL-queries:
{"_index":".kibana","_type":"visualization","_id":"Slowest-MySQL-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Slowest-PgSQL-queries:
{"_index":".kibana","_type":"visualization","_id":"Slowest-PgSQL-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Slowest-Thrift-RPC-methods:
{"_index":".kibana","_type":"visualization","_id":"Slowest-Thrift-RPC-methods","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Sources:
{"_index":".kibana","_type":"visualization","_id":"Sources","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization System-load:
{"_index":".kibana","_type":"visualization","_id":"System-load","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Thrift-requests-per-minute:
{"_index":".kibana","_type":"visualization","_id":"Thrift-requests-per-minute","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Thrift-response-times-percentiles:
{"_index":".kibana","_type":"visualization","_id":"Thrift-response-times-percentiles","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Thrift-RPC-Errors:
{"_index":".kibana","_type":"visualization","_id":"Thrift-RPC-Errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-10-HTTP-requests:
{"_index":".kibana","_type":"visualization","_id":"Top-10-HTTP-requests","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-10-memory-consumers:
{"_index":".kibana","_type":"visualization","_id":"Top-10-memory-consumers","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-10-processes-by-total-CPU-usage:
{"_index":".kibana","_type":"visualization","_id":"Top-10-processes-by-total-CPU-usage","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-Event-IDs:
{"_index":".kibana","_type":"visualization","_id":"Top-Event-IDs","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-processes:
{"_index":".kibana","_type":"visualization","_id":"Top-processes","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-slowest-MongoDB-queries:
{"_index":".kibana","_type":"visualization","_id":"Top-slowest-MongoDB-queries","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-Thrift-RPC-calls-with-errors:
{"_index":".kibana","_type":"visualization","_id":"Top-Thrift-RPC-calls-with-errors","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Top-Thrift-RPC-methods:
{"_index":".kibana","_type":"visualization","_id":"Top-Thrift-RPC-methods","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Total-number-of-HTTP-transactions:
{"_index":".kibana","_type":"visualization","_id":"Total-number-of-HTTP-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Total-time-spent-in-each-MongoDB-collection:
{"_index":".kibana","_type":"visualization","_id":"Total-time-spent-in-each-MongoDB-collection","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading visualization Web-transactions:
{"_index":".kibana","_type":"visualization","_id":"Web-transactions","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard HTTP:
{"_index":".kibana","_type":"dashboard","_id":"HTTP","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard MongoDB-performance:
{"_index":".kibana","_type":"dashboard","_id":"MongoDB-performance","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard MySQL-performance:
{"_index":".kibana","_type":"dashboard","_id":"MySQL-performance","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard Packetbeat-Dashboard:
{"_index":".kibana","_type":"dashboard","_id":"Packetbeat-Dashboard","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard PgSQL-performance:
{"_index":".kibana","_type":"dashboard","_id":"PgSQL-performance","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard Thrift-performance:
{"_index":".kibana","_type":"dashboard","_id":"Thrift-performance","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard Topbeat-Dashboard:
{"_index":".kibana","_type":"dashboard","_id":"Topbeat-Dashboard","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading dashboard Winlogbeat-Dashboard:
{"_index":".kibana","_type":"dashboard","_id":"Winlogbeat-Dashboard","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading index pattern filebeat-*:
{"_index":".kibana","_type":"index-pattern","_id":"filebeat-*","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading index pattern packetbeat-*:
{"_index":".kibana","_type":"index-pattern","_id":"packetbeat-*","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading index pattern topbeat-*:
{"_index":".kibana","_type":"index-pattern","_id":"topbeat-*","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
Loading index pattern winlogbeat-*:
{"_index":".kibana","_type":"index-pattern","_id":"winlogbeat-*","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}
[yinzhengjie@s101 beats-dashboards-1.2.2]$ 
执行load.sh时es必须得启动否则会报错([yinzhengjie@s101 beats-dashboards-1.2.2]$ ./load.sh )

八.在ES中加载FileBeat索引模板

1>.下载FileBeat的索引模板

[yinzhengjie@s101 ~]$ cd download/
[yinzhengjie@s101 download]$ ll
total 623404
drwxrwxr-x  5 yinzhengjie yinzhengjie       148 Mar 24  2016 beats-dashboards-1.2.2
-rw-rw-r--  1 yinzhengjie yinzhengjie    912168 Aug 31 10:04 beats-dashboards-1.2.2.zip
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ curl -O https://gist.githubusercontent.com/thisismitch/3429023e8438cc25b86c/raw/d8c479e2a1adcea8b1fe86570e42abab0f10f364/filebeat-index-template.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   991  100   991    0     0   1431      0 --:--:-- --:--:-- --:--:--  1430
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ ll
total 623408
drwxrwxr-x  5 yinzhengjie yinzhengjie       148 Mar 24  2016 beats-dashboards-1.2.2
-rw-rw-r--  1 yinzhengjie yinzhengjie    912168 Aug 31 10:04 beats-dashboards-1.2.2.zip
-rw-rw-r--  1 yinzhengjie yinzhengjie       991 Aug 31 10:26 filebeat-index-template.json
-rw-r--r--. 1 yinzhengjie yinzhengjie 214092195 Aug 26  2016 hadoop-2.7.3.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 185540433 May 17  2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 yinzhengjie yinzhengjie 201142612 Jul 25  2017 spark-2.1.1-bin-hadoop2.7.tgz
-rw-r--r--. 1 yinzhengjie yinzhengjie  36667596 Jun 20 09:29 zookeeper-3.4.12.tar.gz
[yinzhengjie@s101 download]$ 
[yinzhengjie@s101 download]$ cat filebeat-index-template.json 
{
  "mappings": {
    "_default_": {
      "_all": {
        "enabled": true,
        "norms": {
          "enabled": false
        }
      },
      "dynamic_templates": [
        {
          "template1": {
            "mapping": {
              "doc_values": true,
              "ignore_above": 1024,
              "index": "not_analyzed",
              "type": "{dynamic_type}"
            },
            "match": "*"
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "message": {
          "type": "string",
          "index": "analyzed"
        },
        "offset": {
          "type": "long",
          "doc_values": "true"
        },
        "geoip"  : {
          "type" : "object",
          "dynamic": true,
          "properties" : {
            "location" : { "type" : "geo_point" }
          }
        }
      }
    }
  },
  "settings": {
    "index.refresh_interval": "5s"
  },
  "template": "filebeat-*"
}
[yinzhengjie@s101 download]$ 

2>.使用命令加载模板

[yinzhengjie@s101 download]$ curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' -d@filebeat-index-template.json      #如果加载成功会有如下消息
{
  "acknowledged" : true
}
[yinzhengjie@s101 download]$ 

九.在Client主机上(s102)安装FileBeat软件包

1>.通过scp命令将elk下生成的证书文件远程复制到filebeat所在的client主机

[yinzhengjie@s101 ~]$ scp /etc/pki/tls/certs/logstash-forwarder.crt yinzhengjie@s102:/home/yinzhengjie/data/elk
logstash-forwarder.crt                                                                                                                               100% 1220     1.2KB/s   00:00    
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ ssh s102
Last login: Fri Aug 31 11:30:03 2018 from 172.30.1.1
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ cd data/elk/
[yinzhengjie@s102 elk]$ ll
total 4
-rw-r--r-- 1 yinzhengjie yinzhengjie 1220 Aug 31 11:30 logstash-forwarder.crt
[yinzhengjie@s102 elk]$ 
[yinzhengjie@s102 elk]$ exit 
logout
Connection to s102 closed.
[yinzhengjie@s101 ~]$ 
[yinzhengjie@s101 ~]$ 

2>.将传输过来的证书文件复制到相应的位置下

[yinzhengjie@s102 ~]$ cd data/elk/
[yinzhengjie@s102 elk]$ ll
total 4
-rw-r--r-- 1 yinzhengjie yinzhengjie 1220 Aug 31 11:30 logstash-forwarder.crt
[yinzhengjie@s102 elk]$ 
[yinzhengjie@s102 elk]$ sudo cp logstash-forwarder.crt /etc/pki/tls/certs/

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for yinzhengjie: 
[yinzhengjie@s102 elk]$ 
[yinzhengjie@s102 elk]$ ll /etc/pki/tls/certs/
total 16
lrwxrwxrwx. 1 root root   49 Aug  9 19:15 ca-bundle.crt -> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
lrwxrwxrwx. 1 root root   55 Aug  9 19:15 ca-bundle.trust.crt -> /etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
-rw-r--r--  1 root root 1220 Aug 31 11:36 logstash-forwarder.crt
-rwxr-xr-x. 1 root root  610 Jun 29  2015 make-dummy-cert
-rw-r--r--. 1 root root 2388 Jun 29  2015 Makefile
-rwxr-xr-x. 1 root root  829 Jun 29  2015 renew-dummy-cert
[yinzhengjie@s102 elk]$ 
[yinzhengjie@s102 elk]$ 

3>.在s102导入elasticsearchGPG key 

[yinzhengjie@s102 ~]$ sudo rpm --import  https://packages.elastic.co/GPG-KEY-elasticsearch 
[sudo] password for yinzhengjie: 
[yinzhengjie@s102 ~]$

4>.创建elastic-beats.repo仓库文件 

[yinzhengjie@s102 ~]$ sudo vi  /etc/yum.repos.d/elastic-beats.repo 
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ more /etc/yum.repos.d/elastic-beats.repo 
[beats]
name=Elastic Beats Repository
baseurl=https://packages.elastic.co/beats/yum/el/$basearch
enabeld=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
gpgcheck=1
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ 

5>.安装filebeat

[yinzhengjie@s102 ~]$ sudo yum -y install filebeat
Loaded plugins: fastestmirror
base                                                                                                                                                            | 3.6 kB  00:00:00     
beats                                                                                                                                                           | 2.9 kB  00:00:00     
extras                                                                                                                                                          | 3.4 kB  00:00:00     
updates                                                                                                                                                         | 3.4 kB  00:00:00     
(1/3): extras/7/x86_64/primary_db                                                                                                                               | 187 kB  00:00:01     
(2/3): updates/7/x86_64/primary_db                                                                                                                              | 5.2 MB  00:00:03     
(3/3): beats/x86_64/primary_db                                                                                                                                  |  13 kB  00:00:03     
Determining fastest mirrors
 * base: mirrors.zju.edu.cn
 * extras: mirrors.zju.edu.cn
 * updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package filebeat.x86_64 0:1.3.1-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================================
 Package                                      Arch                                       Version                                       Repository                                 Size
=======================================================================================================================================================================================
Installing:
 filebeat                                     x86_64                                     1.3.1-1                                       beats                                     4.0 M

Transaction Summary
=======================================================================================================================================================================================
Install  1 Package

Total download size: 4.0 M
Installed size: 4.0 M
Downloading packages:
filebeat-1.3.1-x86_64.rpm                                                                                                                                       | 4.0 MB  00:00:19     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : filebeat-1.3.1-1.x86_64                                                                                                                                             1/1 
  Verifying  : filebeat-1.3.1-1.x86_64                                                                                                                                             1/1 

Installed:
  filebeat.x86_64 0:1.3.1-1                                                                                                                                                            

Complete!
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ sudo yum -y install filebeat

 十.配置客户端(s102)的filebeat

1>.在客户端(s102)主机上创建配置文件filebeat.yml.

[yinzhengjie@s102 ~]$ grep -v ^# /etc/filebeat/filebeat.yml | grep -v ^$ | grep -v [#]
filebeat:
  prospectors:
    -
      paths:
    
    - /var/log/secure
    - /var/log/message
      input_type: log
      document_type: syslog
  registry_file: /var/lib/filebeat/registry
output:
  logstash:
    hosts: ["s101:5044"]
    bulk_max_size: 1024
    tls:
      certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"]
shipper:
logging:
  files:
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ 

2>.启动filebeat并使修改生效

[yinzhengjie@s102 ~]$ sudo systemctl start filebeat
[sudo] password for yinzhengjie: 
[yinzhengjie@s102 ~]$ 
[yinzhengjie@s102 ~]$ sudo systemctl enable filebeat
Created symlink from /etc/systemd/system/multi-user.target.wants/filebeat.service to /usr/lib/systemd/system/filebeat.service.
[yinzhengjie@s102 ~]$ 

3>.在S101上测试filebeat的安装

[yinzhengjie@s101 ~]$ curl -XGET 'http://localhost:9200/filebeat-*/_search?pretty'
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 0,
    "successful" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : [ ]
  }
}
[yinzhengjie@s101 ~]$ 

4>.通过Kibana提供的webUI访问(用户名和密码是我们在安装nginx时通过htpasswd来定义的,如果你忘记了的话可以再用改名了重新定义一下即可)

5>.点击登录会进入到Kibana的界面哟

  给大家推荐一个搜索学习资料的网站:https://www.digitalocean.com/community/tutorials,这个平台有很多大牛用英文写的一手好的博客~

原文地址:https://www.cnblogs.com/yinzhengjie/p/9490948.html