Docker Cookbook


Using Elasticsearch and Kibana to Store and Visualize Container Logs | 287



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

9.8 Using Elasticsearch and Kibana to Store and Visualize Container Logs | 287


Figure 9-1. Snapshot of a Kibana dashboard obtained with this recipe
Discussion
In the solution, Elasticsearch is running on a single container. The index created
when storing your logs streamed by Logspout will not persist if you kill and remove
the Elasticsearch container. Consider mounting a volume and backing it up to persist
your Elasticsearch data. In addition, if you need more storage and an efficient index,
you should create an Elasticsearch cluster across multiple Docker hosts.
9.9 Using Collectd to Visualize Container Metrics
Problem
In addition to visualizing application logs (see 
Recipe 9.8
), you would like to monitor
container metrics such as CPU.
Solution
Use 
Collectd
. Run it in a container on all hosts where you have running containers
that you want to monitor. By mounting the 
/var/run/docker.sock
socket in a 
collectd
container, you can use a Collectd plug-in that uses the Docker stats API (see 
Recipe
9.2
) and sends metrics to a Graphite dashboard running in a different host.
This is an advanced recipe that uses several concepts covered ear‐
lier. Make sure to do 
Recipe 7.1
 and 
Recipe 9.8
 before doing this
recipe.
To test this, you’ll use the following setup, with two Docker hosts. One runs four con‐
tainers: an Nginx container used to generate dummy logs to 
stdout
, a Logspout con‐
tainer that will route all 
stdout
logs to a Logstash instance, one that generates a syn‐
thetic load (i.e., 
borja/unixbench
), and one Collectd container. These four containers
can be started using Docker Compose.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   222   223   224   225   226   227   228   229   ...   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