====== Elasticsearch ======
Getting started with the Elastic Stack and Docker Compose: [[https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose|part 1]] ([[https://github.com/elkninja/elastic-stack-docker-part-one|git]]), [[https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose-part-2|part 2]] ([[https://github.com/elkninja/elastic-stack-docker-part-two|git]]).\\
ποΈ [[https://www.youtube.com/watch?v=HOmq3STxAKg|Install Elasticsearch + Kibana 8.x with TLS/SSL]]\\
====== Fluentd ======
https://docs.fluentd.org/configuration\\
https://hub.docker.com/r/fluent/fluentd/
====== Kibana ======
[[https://www.elastic.co/guide/en/kibana/current/docker.html|Install Kibana with Docker]]\\
ΠΠΈΠ±Π°Π½Π° Π½Π°ΡΡΡΠ°ΠΈΠ²Π°Π΅ΡΡΡ ΡΠ΅ΡΠ΅Π· ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΡ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΠΎ [[https://www.elastic.co/guide/en/kibana/current/settings.html|ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ°ΠΌ Π² kibana.yml]], Ρ ΠΊΠ°ΠΏΠΈΡΠ°Π»ΠΈΠ·Π°ΡΠΈΠ΅ΠΉ ΠΈ Π·Π°ΠΌΠ΅Π½ΠΎΠΉ ΡΠΎΡΠ΅ΠΊ Π½Π° ΠΏΠΎΠ΄ΡΡΡΠΊΠΈΠ²Π°Π½ΠΈΡ Π² ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ°Ρ
:
^Environment Variable ^Kibana Setting ^
|SERVER_NAME |server.name |
|SERVER_BASEPATH |server.basePath |
|ELASTICSEARCH_HOSTS |elasticsearch.hosts |
ΠΈ Ρ. Π΄.
===== HTTPS =====
# Π‘ΠΊΠΎΠ½Π²Π΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ ΠΈΡΡ
ΠΎΠ΄Π½ΡΠΉ ΡΡΠΎΡΠΎΠ½Π½ΠΈΠΉ .pfx Π² .crt/.key
openssl pkcs12 -in /tmp/source.pfx -clcerts -nokeys -out /efk/certs/kibana.crt
openssl pkcs12 -in /tmp/source.pfx -nocerts -nodes -out /efk/certs/kibana.key
https://tipoit.kz/elk-install-kibana
kibana:
depends_on:
es01:
condition: service_healthy
image: kibana:${STACK_VERSION}
labels:
co.elastic.logs/module: kibana
volumes:
- ./certs:/usr/share/kibana/config/certs
- ./kibanadata:/usr/share/kibana/data
- ./kibana.yml:/usr/share/kibana/config/kibana.yml:ro
ports:
- ${KIBANA_PORT}:5601
environment:
- SERVERNAME=kibana
- ELASTICSEARCH_HOSTS=https://es01:9200
- ELASTICSEARCH_USERNAME=kibana_system
- ELASTICSEARCH_PASSWORD=${KIBANA_PASSWORD}
- ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt
- XPACK_SECURITY_ENCRYPTIONKEY=${ENCRYPTION_KEY}
- XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY=${ENCRYPTION_KEY}
- XPACK_REPORTING_ENCRYPTIONKEY=${ENCRYPTION_KEY}
- XPACK_REPORTING_KIBANASERVER_HOSTNAME=localhost
- SERVER_SSL_ENABLED=true
- SERVER_SSL_CERTIFICATE=config/certs/kibana/kibana.crt
- SERVER_SSL_KEY=config/certs/kibana/kibana.key
- SERVER_SSL_CERTIFICATEAUTHORITIES=config/certs/ca/ca.crt
mem_limit: ${KB_MEM_LIMIT}
healthcheck:
test:
[
"CMD-SHELL",
"curl -I -s --cacert config/certs/ca/ca.crt https://localhost:5601 | grep -q 'HTTP/1.1 302 Found'",
]
interval: 10s
timeout: 10s
retries: 120
https://github.com/elkninja/elastic-stack-docker-part-two/blob/main/docker-compose.yml
===== ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ =====
ΠΡΠ°ΠΏΡ ΠΏΡΠΎΡ
ΠΎΠΆΠ΄Π΅Π½ΠΈΡ Π»ΠΎΠ³ΠΎΠ² Π²ΠΎ Π€Π»ΡΠ΅Π½ΡΠ΅:\\
Source -> Format -> Output
ΠΠ»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΡΡΠ°ΠΏΠ° Π΅ΡΡΡ ΡΠ²ΠΎΠΈ ΠΏΠ»Π°Π³ΠΈΠ½Ρ, Ρ. Π΅., Π΄Π»Ρ ΡΠ±ΠΎΡΠ° ΠΈΠ· ΡΠ°Π·Π½ΡΡ
ΠΈΡΡΠΎΡΠ½ΠΈΠΊΠΎΠ² (ΡΠ°ΠΉΠ»Ρ, systemd ΠΈ Ρ .ΠΏ.), ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ/Π΄ΠΎΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ/ΡΡΠ³ΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΈ ΠΎΡΠΏΡΠ°Π²ΠΊΠΈ Π² ΡΠ°Π·Π½ΡΠ΅ ΡΠΈΡΡΠ΅ΠΌΡ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, Elasticsearch).
====== ΠΠΈΡΠ΅ΡΠ°ΡΡΡΠ° ======
Docker logging: https://www.fluentd.org/guides/recipes/docker-logging\\
ΠΠ°ΠΊ Π½Π°ΡΡΡΠΎΠΈΡΡ ΡΠ΅Π½ΡΡΠ°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π½ΠΎΠ΅ Π»ΠΎΠ³ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π»Ρ Docker Swarm Ρ ΠΏΠΎΠΌΠΎΡΡΡ Fluentd: https://cloud.vk.com/docs/cases/cases-logs/case-swarm\\
Better Log Parsing with Fluentd: https://work.haufegroup.io/fluentd-log-parsing/\\
Docker Setup Monitoring: https://www.frederikbanke.com/docker-setup-monitoring/\\
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° ΡΠ΅Π½ΡΡΠ°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ Π»ΠΎΠ³ΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π² Docker Ρ ΠΏΡΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ΠΌ EFK Stack: https://daffin.ru/devops/docker/efk/\\
[[https://www.youtube.com/playlist?list=PLPatHYWw1RVuaGUCZoqEnoqkxLed2jr-u|Elasticsearch + Docker-compose]], ΡΠ°ΠΊΠΆΠ΅ ΡΠΌ. Π²Π΅ΡΡ ΠΊΠ°Π½Π°Π»\\