Docker Cookbook


| Chapter 9: Monitoring Containers



Download 6,31 Mb.
Pdf ko'rish
bet224/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   220   221   222   223   224   225   226   227   ...   260
Bog'liq
Docker Cookbook

284 | Chapter 9: Monitoring Containers


$ vagrant ssh elk
$ cd /vagrant
$ docker build -t logstash .
$ docker run -d --name logstash -p 5000:5000/udp logstash -f /etc/logstash.conf
You should see your Nginx logs in the Logstash container. Experiment with more
hosts and different containers, and play with the Logstash plug-ins to store your logs
in different formats.
See Also

Logstash
 website
• Configuration of 
Logstash

Plug-ins
 for Logstash inputs, outputs, codecs, and filters
9.7 Managing Logspout Routes to Store Container Logs
Problem
You are using Logspout to stream your logs to a remote server, but you would like to
modify this endpoint. Specifically, you want to debug your containers by looking
directly at Logspout, change the endpoint it uses, or add more endpoints.
Solution
In 
Recipe 9.6
, you might have noticed that the Logspout container has port 8000
exposed. You can use this port to manage routes via a straightfoward HTTP API.
You can bind port 8000 to the host to access this API remotely, but as an exercise you
are going to use a linked container to do it locally. Pull an image that contains 
curl
and start a container interactively. Verify that you can ping the Logspout container
(here I assume that you have the same setup as in 
Recipe 9.6
). Then use 
curl
to
access the Logspout API at 
http://logspout:8000
.
$ docker pull tutum/curl
$ docker run -ti --link logspout:logspout tutum/curl /bin/bash
root@c94a4eacb7cc:/# ping logspout
PING logspout (172.17.0.10) 56(84) bytes of data.
64 bytes from logspout (172.17.0.10): icmp_seq=1 ttl=64 time=0.075 ms
...
root@c94a4eacb7cc:/# curl http://logspout:8000/logs
logspout|[martini] Started GET /logs for 172.17.0.12:38353
nginx|192.168.34.1 [10/Mar/2015:13:57:38 +0000] "GET / HTTP/1.1" 200 ...
nginx|192.168.34.1 [10/Mar/2015:13:57:43 +0000] "GET / HTTP/1.1" 200 ...

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   220   221   222   223   224   225   226   227   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish