技术控

    今日:88| 主题:49270
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] Docker Stats Monitoring: Taking Dockbeat for a Ride

[复制链接]
百年不腻好吗 发表于 2016-10-6 23:57:17
225 16

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

Docker Stats Monitoring: Taking Dockbeat for a Ride-1 (containers,difficult,contrary,solution,perfect)

  There is no silver bullet. This is how I always answer those asking about the best logging solution for Docker. A bit pessimistic of me, I know. But what I’m implying with that statement is that there is no perfect method for gaining visibility into containers. Dockerized environments are distributed, dynamic, and multi-layered in nature, so they are extremely difficult to log.
   That’s not to say that there are no solutions — to the contrary. From Docker’s logging drivers to logging containers to using data volumes, there are plenty of ways to log Docker, but all have certain limitations or pitfalls. Logz.io users use a dedicated container that acts as a log collector by pulling Docker daemon events, stats, and logs into our ELK Stack (Elasticsearch, Logstash and Kibana).
   That’s why I was curious to hear about the first release of Dockbeat (called Dockerbeat prior to Docker’s new repo naming conventions) — the latest addition to Elastic’s family of beats, which is a group of different log collectors developed for different environments and purposes. Dockbeat was contributed by the ELK community and is focused on using the docker stats API to push container resource usage metrics such as memory, IO, and CPU to either Elasticsearch or Logstash.
   Below is a short review of how to get Dockbeat up and running as well as a few personal first impressions by me. My environment was a locally installedELK Stack and Docker on Ubuntu 14.04.
  Installing Dockbeat

   To get Dockbeat up and running, you can either build the project yourself or use the binary release on the GitHub repository . The former requires some additional setup steps (installing Go and Glide, for starters), and I eventually opted for the latter. It took just a few steps and proved to be pretty painless (an additional method is to run Dockbeat as a container — see the repo’s readme for more details).
   You will first need to download the source code and release package from: https://github.com/Ingensi/dockbeat/releases
  [code]$ gitclone https://github.com/Ingensi/dockbeat.git
$ wgethttps://github.com/Ingensi/dockbeat/releases/download/v1.0.0/dockbeat-v1.0.0-x86_64
[/code]  Configuring and Running Dockbeat

   Before you start Dockbeat, there is the matter of configurations. Since I used a vanilla installation with Docker and ELK installed locally, I did not need to change a thing in the supplied dockbeat.yml file.
  Dockbeat is configured to connect to the default Docker socket:
  [code]dockbeat
  socket: ${DOCKER_SOCKET:unix:///var/run/docker.sock}
[/code]  My local Elasticsearch was already defined in the output section:
  [code]### Elasticsearch as output
     elasticsearch
          hosts: [“localhost:9200”]
[/code]  Of course, if you’re using a remotely installed Elasticsearch or Logstash instance, you will need to change these configurations respectively.
  Before you start Dockbeat, you will need to grant execution permissions to the binary file:
  [code]$ chmod +x dockbeat-v1.0.0-x86_64
[/code]  Then, to start Dockbeat, use the following run command:
  [code]./dockbeat-v1.0.0-x86_64 -c dockbeat-1.0.0/dockbeat.yml -v -e
[/code]  Please note: I used the two optional parameters (‘-v’, ‘-e’) to see the output of the run command, but these, of course, are not mandatory.
  Dockbeat then runs, and if all goes as expected, you should see the following lines in the debug output:
  [code]2016/09/18 09:13:40.851229 beat.go:173: INFOdockbeatsuccessfullysetup. Startrunning.
2016/09/18 09:13:40.851278 dockbeat.go:196: INFOdockbeat%!(EXTRAstring=dockbeatis running! HitCTRL-C to stopit.)
2016/09/18 09:14:47.101231 dockbeat.go:320: INFOdockbeat%!(EXTRAstring=Publishing %v events, int=5)
...
[/code]  It seems like all is working as expected, so my next step is to ping Elasticsearch:
  [code]$ curllocalhost:9200/_cat/indices
[/code]  The output displayed displays a cross-section of Elasticsearch indices:
  [code]yellowopendockbeat-2016.09.18 5 1 749 0 773.7kb 773.7kb

yellowopen .kibana             1 1   1 0   3.1kb   3.1kb
[/code]   The next step is to define the index pattern in Kibana. After clicking on the Setting tab in Kibana, I entered dockbeat.* in the index name/pattern field and selected the @timestamp filter to create the new index pattern:
  


Docker Stats Monitoring: Taking Dockbeat for a Ride-2 (containers,difficult,contrary,solution,perfect)

  Now, all the metrics collected by Dockbeat and stored by Elasticsearch are listed in the Visualize tab in Kibana:
  

1234下一页
友荐云推荐




上一篇:15 Interesting JavaScript and CSS Libraries for October 2016
下一篇:What’s New in Logz.io — September 2016
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

lzy156 发表于 2016-10-7 06:14:09
百年不腻好吗今年多大了?
回复 支持 反对

使用道具 举报

蒋鑫 发表于 2016-10-7 06:30:23
沙发是我的,谁也不要抢!
回复 支持 反对

使用道具 举报

ieinq 发表于 2016-10-10 03:21:08
生前何必久睡,死后自会长眠……
回复 支持 反对

使用道具 举报

邓效 发表于 2016-10-11 13:43:03
前排支持下了哦~
回复 支持 反对

使用道具 举报

长发不失风采 发表于 2016-10-11 16:55:02
广告位,坐下看看
回复 支持 反对

使用道具 举报

zxlplayklc 发表于 2016-10-11 17:44:45
虫星人来了,都叫兽呢?
回复 支持 反对

使用道具 举报

玩偶的眼泪 发表于 2016-10-12 09:41:36
收藏了,怕楼主删了!
回复 支持 反对

使用道具 举报

webking 发表于 2016-10-31 22:50:30
谁喷了榴莲味儿的香水?
回复 支持 反对

使用道具 举报

民工甲 发表于 2016-11-1 06:11:04
来,来,干了这杯翔!
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表