Notice
Recent Posts
Recent Comments
Link
ยซ   2025/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

midnightly

[ELK Stack] ๊ตฌ์„ฑํ•˜๊ธฐ (1) - Elasticsearch ์„ค์น˜ ๋ณธ๋ฌธ

ELK

[ELK Stack] ๊ตฌ์„ฑํ•˜๊ธฐ (1) - Elasticsearch ์„ค์น˜

๋น„๋ฒ„๋ฒ„๋น„ 2021. 10. 14. 16:08

๐Ÿ“Œ ํ™˜๊ฒฝ ๊ตฌ์„ฑ

๊ตฌ๋ถ„ ์‚ฌ์–‘
OS Cent OS 8
CPU 2 Core
RAM 4 GB
DISK 20 GB

 

1. ์œ„ ์กฐ๊ฑด์œผ๋กœ ๊ตฌ์„ฑ๋œ VM 3๊ฐœ๋ฅผ ์ค€๋น„ํ•œ๋‹ค.

 - 1๋ฒˆ VM์— ElasticSearch, Kibana, LogStash, Beats๋ฅผ ์„ค์น˜

 - 2, 3๋ฒˆ VM์—๋Š” ElasticSearch๋งŒ ์„ค์น˜

 

2. ๋ฐฉํ™”๋ฒฝ ์ค‘์ง€

systemctl stop firewalld

 

 

 

๐Ÿ“Œ ์„ค์น˜

1. ElasticSearch (๐Ÿ“ข ๋ชจ๋“  VM์— ๋™์ผํ•œ ์ž‘์—… ์ˆ˜ํ–‰)

  (1) ์‚ฌ์šฉ์ž ์ถ”๊ฐ€

    - ES๋Š” root ๊ณ„์ •์œผ๋กœ ์‹คํ–‰์ด ์•ˆ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉ์ž ๊ณ„์ •์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

useradd elastic

 

    - ์ƒ์„ฑํ•œ ๊ณ„์ •์œผ๋กœ ์ „ํ™˜ํ•œ๋‹ค.

su - elastic

 

  (2) ElasticSearch ๋‹ค์šด & ์••์ถ• ํ’€๊ธฐ

    - https://www.elastic.co/kr/downloads/elasticsearch ์ ‘์†ํ•ด์„œ LINUX X86_64 ๋งํฌ ์ฃผ์†Œ ๋ณต์‚ฌ ํด๋ฆญ

 

    - wget์œผ๋กœ ํŒŒ์ผ ๋‹ค์šด

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.0-linux-x86_64.tar.gz

 

    - ์••์ถ• ํ•ด์ œ

tar -xvzf elasticsearch-7.15.0-linux-x86_64.tar.gz

 

 

  (3) elasticsearch.yml ์ˆ˜์ •

    - config/elasticsearch.yml ํŒŒ์ผ์„ ์ˆ˜์ •ํ•œ๋‹ค.

cluster.name: es-cluster # ํด๋Ÿฌ์Šคํ„ฐ ์ด๋ฆ„์€ ๋™์ผํ•ด์•ผ ํ•จ
node.name: node01
network.host: 192.168.137.101
http.port: 9200
discovery.seed_hosts: ["192.168.137.101", "192.168.137.102", "192.168.137.103"]
cluster.initial_master_nodes: ["node01", "node02", "node03"]
node.master: true
node.data: true
node.ingest: true
gateway.recover_after_nodes: 3

 

  (4) ์‹คํ–‰

    - ES๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

bin/elasticsearch

 

    - ์ฃผ์†Œ๋กœ ์ ‘์†ํ•ด์„œ ES๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰์ด ๋๋Š”์ง€ ํ™•์ธ

curl http://192.168.137.101:9200

Comments