一、ES单机安装
1、windows[版本 5.6.4]
步骤一: 下载
https://www.elastic.co/cn/products/elasticsearch
步骤二:运行msi
步骤三:执行
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: