Elastic Search系统学习之一: 入门

一、ES单机安装

1、windows[版本 5.6.4]

     步骤一: 下载

     https://www.elastic.co/cn/products/elasticsearch 

    步骤二:运行msi

  


images/msi_installer/msi_installer_locations.png


images/msi_installer/msi_installer_success.png

步骤三:执行

C:\Windows\system32>cd %PROGRAMFILES%\Elastic\Elasticsearch\bin
C:\Program Files\Elastic\Elasticsearch\bin>.\elasticsearch.exe


2、安装kibana

步骤一:下载

    https://www.elastic.co/cn/downloads/kibana

步骤二:解压

步骤三:修改配置

            config/kibana.yml

            elasticsearch.url 指向es的实例,默认是9200端口

步骤四:运行

          bin\kibana.bat

步骤五:健康检查

     打开kibana: localhost:5601

    点击: dev tools

   

    检查一:集群健康状况

                  GET /_cat/health?v

                   或 cmd中输入:

                  curl -XGET  localhost:9200/_cat/health?v&pretty

     检查二:获取节点列表

                 GET /_cat/nodes?v

                或cmd中输入

                curl -XGET  localhost:9200/_cat/nodes?v&pretty
     检查三: 获取indeces列表

                GET /_cat/indices?v

                 或者

                curl -XGET  localhost:9200/_cat/indices?v&pretty
3、logstash安装与使用示例
     步骤一:下载

          https://www.elastic.co/downloads/logstash

     步骤二:启动Logstash并验证

                     存储示例

                            lxq@slave-01:~/elastic-search/logstash-6.0.0$ bin/logstash
                            Sending Logstash's logs to /home/lxq/elastic-search/logstash-6.0.0/logs which is now configured via log4j2.properties
                             ... ...
                            [2017-11-16T12:04:30,674][INFO ][logstash.agent           ] Pipelines running {:count=>1, :pipelines=>["main"]}
                            hello,world             //输入
                            2017-11-16T04:05:13.809Z slave-01 hello,world //输出


     步骤三: 简单配置示例

               1> 配置文件: logstash-simple.conf

                 

input { stdin { } }
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}

                  输入: 标准输入

                  输出:  标准输出,elasticsearch

               2> 运行:$ bin/logstash -f logstash-simple.conf
               输入:this is my choice

               输出:

               lxq@slave-01:~/elastic-search/no-x-pack/logstash-6.0.0$ sh start.sh

               ......

               The stdin plugin is now waiting for input:
                [2017-11-17T10:44:41,032][INFO ][logstash.agent           ] Pipelines running {:count=>1, :pipelines=>["main"]}
                this is my choice
               {
                    "@version" => "1",
                    "host" => "slave-01",
                    "@timestamp" => 2017-11-17T02:44:46.210Z,
                    "message" => "this is my choice"
               }


             3>  查看kibana:

             

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值