添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

最近看了elasticsearch出了7.x的版本,加上项目中用elasticsearch挺频繁,索性记录下学习的过程,一开始,准备在本机上面搭建ELK

搭建ELK——elasticsearch

选择合适的版下载本: www.elastic.co/cn/download…

下载完成后解压后进入目录

➜  elasticsearch-7.2.0 ls
LICENSE.txt    NOTICE.txt     README.textile bin            config         data           jdk            lib            logs           modules        plugins

启动命令:

bin/elasticsearch

浏览器输入地址:http://localhost:9200 看到如下界面为安装成功

"name": "zhangpeileideMacBook-Pro.local", "cluster_name": "elasticsearch", "cluster_uuid": "s_wuhCF5Q_-pf7iZ5NNxYg", "version": { "number": "7.2.0", "build_flavor": "default", "build_type": "tar", "build_hash": "508c38a", "build_date": "2019-06-20T15:54:18.811730Z", "build_snapshot": false, "lucene_version": "8.0.0", "minimum_wire_compatibility_version": "6.8.0", "minimum_index_compatibility_version": "6.0.0-beta1" "tagline": "You Know, for Search"

搭建ELK——logstash

选择合适的版本下载:www.elastic.co/cn/download…

进入解压后目录:

➜  logstash-7.2.0 ls
CONTRIBUTORS             Gemfile.lock             NOTICE.TXT               config                   lib                      logstash-core            modules                  vendor
Gemfile                  LICENSE.txt              bin                      data                     logs                     logstash-core-plugin-api tools                    x-pack

进入config目录后,修改logstash.conf文件如下

# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
    file{
        path => "/Users/zhangpeilei/test.txt"
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "test-%{+YYYY.MM.dd}"
    #user => "elastic"
    #password => "changeme"

实现效果:将/Users/zhangpeilei/test.txt文件内容写入到ES

执行启动命令

bin/logstash -f config/logstash.conf

搭建ELK——Kibana

选择合适的版下载本:www.elastic.co/cn/download…

进入解压后目录

➜  kibana-7.2.0-darwin-x86_64 ls
LICENSE.txt  NOTICE.txt   README.txt   bin          built_assets config       data         node         node_modules optimize     package.json plugins      src          target       webpackShims x-pack

配置文件config/kibana.yml修改这一行:elasticsearch.hosts: ["http://localhost:9200"]

bin/kibana

启动ELK

浏览器输入:http://localhost:5601 配置完索引后即可看到数据

更多文章关注博客:www.zplxjj.com和公众号

粉丝