ELK ์Šคํƒ ์‹ค์Šต

docker-elk

์šฐ์„  ๋ฐฉ๋Œ€ํ•œ ์–‘์˜ ์„ค์ •์„ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋„์™€์ฃผ๋Š” ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ ์กด์žฌํ•œ๋‹ค.

docker-elk ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋„์ปค ์ด๋ฏธ์ง€๋Š” ๊ณต์‹ ์‚ฌ์ดํŠธ๋กœ๋ถ€ํ„ฐ ๊ฐ€์ ธ์™€ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.

๋‹น์—ฐํ•˜์ง€๋งŒ ๋„์ปค์™€ ๋„์ปค์ปดํฌ์ฆˆ์˜ ์„ค์น˜๊ฐ€ ํ•„์š”ํ•˜๋‹ค.

์‹คํ–‰ ๋ฐฉ๋ฒ•

readme์— ์žˆ๋Š”๋Œ€๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค. ํ•˜์ง€๋งŒ ๋ช‡ ๋ฒˆ ๋ฐ˜๋ณตํ•ด๋ณด๋‹ˆ, ํ•™์Šต๋ชฉ์ ์ผ ๋•Œ์—๋Š” ๊ธด ๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์„ค์ • ๋ฐฉ๋ฒ•์„ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ผ๊ฐˆ ํ•„์š” ์—†์ด .envํŒŒ์ผ์„ ์ˆ˜์ •ํ•ด์„œ ๋ช‡ ๊ฐœ์˜ ์Šคํ…์„ ๊ฑด๋„ˆ๋›ธ ์ˆ˜ ์žˆ๋‹ค.

  1. .envํŒŒ์ผ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ˆ˜์ •

์œ„์™€๊ฐ™์ด ์ˆ˜์ •ํ•ด ์ค„ ์ˆ˜ ์žˆ๋‹ค. ์ตœ์†Œ 6์ž๋ฅผ ์•ˆ๋งž์ถ”๋ฉด setup์— ์‹คํŒจํ•˜๋‹ˆ ๋‘๋ฒˆ ์ผํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์ž.

  1. setup
docker compose up setup
WARN[0000] mount of type `volume` should not define `bind` option 
[+] Running 4/4
 โœ” Network docker-elk_elk                Created    0.0s 
 โœ” Volume "docker-elk_elasticsearch"     Created    0.0s 
 โœ” Container docker-elk-elasticsearch-1  Created    0.1s 
 โœ” Container docker-elk-setup-1          Created    0.0s 
Attaching to setup-1
setup-1  | [+] Waiting for availability of Elasticsearch. This can take several minutes.
setup-1  |    โ ฟ Elasticsearch is running
setup-1  | [+] Waiting for initialization of built-in users
setup-1  |    โ ฟ Built-in users were initialized
setup-1  | [+] Role 'filebeat_writer'
setup-1  |    โ ฟ Creating/updating
setup-1  | [+] Role 'heartbeat_writer'
setup-1  |    โ ฟ Creating/updating
setup-1  | [+] Role 'logstash_writer'
setup-1  |    โ ฟ Creating/updating
setup-1  | [+] Role 'metricbeat_writer'
setup-1  |    โ ฟ Creating/updating
setup-1  | [+] User 'metricbeat_internal'
setup-1  |    โ ฟ No password defined, skipping
setup-1  | [+] User 'logstash_internal'
setup-1  |    โ ฟ User does not exist, creating
setup-1  | [+] User 'filebeat_internal'
setup-1  |    โ ฟ No password defined, skipping
setup-1  | [+] User 'kibana_system'
setup-1  |    โ ฟ User exists, setting password
setup-1  | [+] User 'heartbeat_internal'
setup-1  |    โ ฟ No password defined, skipping
setup-1  | [+] User 'monitoring_internal'
setup-1  |    โ ฟ No password defined, skipping
setup-1  | [+] User 'beats_system'
setup-1  |    โ ฟ No password defined, skipping
setup-1 exited with code 0

์‹œ๊ฐ„์ด ์กฐ๊ธˆ ๊ฑธ๋ฆฌ๋‹ˆ, ํ—ท๊ฐˆ๋ ค์„œ ์ข…๋ฃŒํ•˜๋Š” ์ผ ์—†์ด code 0๊นŒ์ง€ ๋ณด๋„๋ก ํ•˜์ž.

  1. docker compose up -d

์œ„์˜ ๋ช…๋ น์–ด๋ฅผ ๊ทธ๋Œ€๋กœ ์‹คํ–‰์‹œํ‚ค์ž. ๊ทธ๋Ÿผ id: elastic / pw: ์ง€์ •ํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์„œ localhost:5601

์œ„์™€ ๊ฐ™์€ kibana ํ™”๋ฉด์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

TODO

    • ํŒŒ์ด์ฌ ์†Œ์ผ“. ๋น„๋™๊ธฐ vs ๋™๊ธฐ ์ •ํ•˜๊ธฐ
    • ํ•œ๊ตญ ํˆฌ์ž ์ฆ๊ถŒ ๊ฐœ์„คํ›„ ์–ด๋–ค ๋ฐ์ดํ„ฐ ์“ธ์ง€ ์ •ํ•˜๊ธฐ. ๊ฐœ๋ฐœ ํ•ด๋ณด๊ธฐ.
    • ํŒ€ ์ด๋ฆ„ ์ •ํ•˜๊ธฐ