docker环境搭建ELK

docker搭建系列

ELK是开源日志界的三大剑客,本文主要讲怎么在docker里头跑起来这一套东东。

镜像

这里采用docker-elk的镜像。

运行

cd docker-elk
eval "$(docker-machine env default)"
docker-compose up -d
...
Successfully built 68f1e0777077
Creating dockerelk_kibana_1
Attaching to dockerelk_elasticsearch_1, dockerelk_logstash_1, dockerelk_kibana_1
kibana_1        | Stalling for Elasticsearch
kibana_1        | Starting Kibana
elasticsearch_1 | [2016-02-03 12:01:46,067][INFO ][node                     ] [Caretaker] version[2.2.0], pid[1], build[8ff36d1/2016-01-27T13:32:39Z]
elasticsearch_1 | [2016-02-03 12:01:46,068][INFO ][node                     ] [Caretaker] initializing ...
elasticsearch_1 | [2016-02-03 12:01:46,615][INFO ][plugins                  ] [Caretaker] modules [lang-expression, lang-groovy], plugins [], sites []
elasticsearch_1 | [2016-02-03 12:01:46,635][INFO ][env                      ] [Caretaker] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda1)]], net usable_space [14gb], net total_space [18.1gb], spins? [possibly], types [ext4]
elasticsearch_1 | [2016-02-03 12:01:46,635][INFO ][env                      ] [Caretaker] heap size [1015.6mb], compressed ordinary object pointers [true]
elasticsearch_1 | [2016-02-03 12:01:49,038][INFO ][node                     ] [Caretaker] initialized
elasticsearch_1 | [2016-02-03 12:01:49,040][INFO ][node                     ] [Caretaker] starting ...
elasticsearch_1 | [2016-02-03 12:01:49,120][INFO ][transport                ] [Caretaker] publish_address {172.17.0.6:9300}, bound_addresses {[::]:9300}
elasticsearch_1 | [2016-02-03 12:01:49,130][INFO ][discovery                ] [Caretaker] elasticsearch/jOBlX_T5TYmgeE6jHP-z0Q
elasticsearch_1 | [2016-02-03 12:01:52,207][INFO ][cluster.service          ] [Caretaker] new_master {Caretaker}{jOBlX_T5TYmgeE6jHP-z0Q}{172.17.0.6}{172.17.0.6:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
elasticsearch_1 | [2016-02-03 12:01:52,250][INFO ][http                     ] [Caretaker] publish_address {172.17.0.6:9200}, bound_addresses {[::]:9200}
elasticsearch_1 | [2016-02-03 12:01:52,251][INFO ][node                     ] [Caretaker] started
elasticsearch_1 | [2016-02-03 12:01:52,259][INFO ][gateway                  ] [Caretaker] recovered [0] indices into cluster_state
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["warning","config"],"pid":1,"key":"bundled_plugin_ids","val":["plugins/dashboard/index","plugins/discover/index","plugins/doc/index","plugins/kibana/index","plugins/markdown_vis/index","plugins/metric_vis/index","plugins/settings/index","plugins/table_vis/index","plugins/vis_types/index","plugins/visualize/index"],"message":"Settings for \"bundled_plugin_ids\" were not applied, check for spelling errors and ensure the plugin is loaded."}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:sense","info"],"pid":1,"name":"plugin:sense","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:kibana","info"],"pid":1,"name":"plugin:kibana","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:elasticsearch","info"],"pid":1,"name":"plugin:elasticsearch","state":"yellow","message":"Status changed from uninitialized to yellow - Waiting for Elasticsearch","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:kbn_vislib_vis_types","info"],"pid":1,"name":"plugin:kbn_vislib_vis_types","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:markdown_vis","info"],"pid":1,"name":"plugin:markdown_vis","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:metric_vis","info"],"pid":1,"name":"plugin:metric_vis","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:spyModes","info"],"pid":1,"name":"plugin:spyModes","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:statusPage","info"],"pid":1,"name":"plugin:statusPage","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["status","plugin:table_vis","info"],"pid":1,"name":"plugin:table_vis","state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:44+00:00","tags":["listening","info"],"pid":1,"message":"Server running at http://0.0.0.0:5601"}
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:49+00:00","tags":["status","plugin:elasticsearch","info"],"pid":1,"name":"plugin:elasticsearch","state":"yellow","message":"Status changed from yellow to yellow - No existing Kibana index found","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
elasticsearch_1 | [2016-02-03 13:21:50,104][INFO ][cluster.metadata         ] [Caretaker] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [config]
elasticsearch_1 | [2016-02-03 13:21:50,489][INFO ][cluster.routing.allocation] [Caretaker] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[.kibana][0]] ...]).
kibana_1        | {"type":"log","@timestamp":"2016-02-03T13:21:53+00:00","tags":["status","plugin:elasticsearch","info"],"pid":1,"name":"plugin:elasticsearch","state":"green","message":"Status changed from yellow to green - Kibana index ready","prevState":"yellow","prevMsg":"No existing Kibana index found"}

查看kibana

http://192.168.99.100:5601/
图片描述

查看sense

http://192.168.99.100:5601/app/sense
图片描述

默认端口

  • 5000: Logstash TCP input.

  • 9200: Elasticsearch HTTP

  • 9300: Elasticsearch TCP transport

  • 5601: Kibana


code-craft
spring boot , docker and so on 欢迎关注微信公众号: geek_luandun

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很...

11.8k 声望
2k 粉丝
0 条评论
推荐阅读
2022年终总结
最近两年开始陷入颓废中,博客也写的越来越少了。究其原因,主要还是陷入了职业倦怠期,最近一次跳槽感觉颇为失败,但是碍于给的薪资高,为了五斗米折腰,又加上最近行情不好,想要往外跳也跳不了,就这样子一直...

codecraft阅读 724

Docker学习:Image的本地存储结构
在使用Docker时候,针对镜像的操作一般就是docker pull,docker build,docker commit(刚开始接触Docker的时候,还不会Dockerfile,经常使用这个命令,但是经历了一次血的教训,已经放弃这个命令很久)这些操作...

backbp4阅读 9.8k评论 3

使用docker快速搭建xssPlatform测试平台实践
笔者之前给一些开发团队多次做Web安全开发培训,为了让培训的学员能够理解XSS原理和XSS的危害,将xssPlatform进行了更新,之前一直放在GitHub中;发现关注的人越来越多,很多人在安装的过程中遇到问题不知道怎么...

汤青松1阅读 25.8k

利用Docker部署管理LDAP及其初次使用
前言:本周主要写了gitlabWebhook转github的项目,总体上没有遇到什么大问题,这周接触到了LDAP,于是就花时间实际操作了解了一下。

李明5阅读 930

Kubernetes v1.26 新特性一览
我每期的 「k8s生态周报」都有一个叫上游进展的部分,所以很多值得关注的内容在之前的文章中已经发过了。这篇中我会再额外介绍一些之前未涵盖的,和之前介绍过的值得关注的内容。

张晋涛2阅读 674评论 1

封面图
深入剖析容器网络和 iptables
Docker 能为我们提供很强大和灵活的网络能力,很大程度上要归功于与 iptables 的结合。在使用时,你可能没有太关注到 iptables 的作用,这是因为 Docker 已经帮我们自动完成了相关的配置。

张晋涛3阅读 1.3k

封面图
Kubernetes 证书管理系列(一)
大家好,我是张晋涛。这是一个系列文章,将会通过七篇内容和大家一起聊聊 Kubernetes 中的证书管理。以下是内容概览:如上所示,在第一篇中,我们将从原理出发,来理解 Kubernetes 中的证书及其相关的作用,然后...

张晋涛2阅读 855

封面图

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很...

11.8k 声望
2k 粉丝
宣传栏