๋กœ์ผ“๐Ÿพ
article thumbnail

 

ElasticSearch๋Š” url์„ ์ด์šฉํ•ด์„œ ์‰ฝ๊ฒŒ ๋ฐ์ดํ„ฐ ์ „์†ก์ด ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ElasticSearch๋ฅผ ์ด์šฉํ•˜์—ฌ ์„œ๋น„์Šค๋ฅผ ํ•  ๋•Œ ๋ฐ˜๋“œ์‹œ ๋ณด์•ˆ์„ค์ •์„ ํ•ด์ฃผ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋งŒ์•ฝ ํ•ด์ฃผ์ง€ ์•Š๋Š”๋‹ค๋ฉด ์ž„์˜์˜ ์‚ฌ์šฉ์ž๊ฐ€ ๋งˆ์Œ๋Œ€๋กœ CRUD ์ž‘์—…์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

๋”ฐ๋ผ์„œ ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” ElasticSearch์™€ Kibana์— ๋ณด์•ˆ์„ ์ ์šฉํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

 

*์ฐธ๊ณ  : ๋ณด์•ˆ ์ ์šฉ ๋ฒ•์€ ์•„๋ž˜ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์— ์ž์„ธํžˆ ๋‚˜์™€์žˆ์Šต๋‹ˆ๋‹ค.

 

Set up minimal security for Elasticsearch | Elasticsearch Guide [7.12] | Elastic

The ES_PATH_CONF variable is the path for the Elasticsearch configuration files. If you installed Elasticsearch using archive distributions (zip or tar.gz), the variable defaults to ES_HOME/config. If you used package distributions (Debian or RPM), the var

www.elastic.co

 

์„œ๋ฒ„๋Š” CentOS7์ด๊ณ , ElasticSearch๋Š” yum์ด ์•„๋‹Œ tar.gz๋กœ ๋‹ค์šด๋ฐ›์•˜์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ๋Š” ๋‹ค๋ฅผ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

# vi /home/es/elasticsearch-7.13.4/config/elasticsearch.yml

elasticsearch.yml ํŒŒ์ผ์— ์•„๋ž˜์™€ ๊ฐ™์ด ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค.

xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

์„ค์ • ํ›„ elasticsearch๋ฅผ ์žฌ์‹œ์ž‘ ํ•ด์ค๋‹ˆ๋‹ค.

# systemctl stop elasticsearch
# systemctl start elasticsearch

* ์ฐธ๊ณ  : ElasticSearch๋Š” root ๊ณ„์ •์œผ๋กœ ์‹คํ–‰์‹œํ‚ฌ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ๊ธ€์„ ์ฐธ๊ณ ํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

[ElasticSearch] org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

Elasticsearch 5.0 ์ดํ›„์—์„œ๋Š” root์—์„œ elasticsearch๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์—†๊ฒŒ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— sudo ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  Elasticsearch๋ฅผ ์‹คํ–‰ ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ณ„์ •์„ ์ƒˆ๋กœ ์ƒ์„ฑ ํ•œ ํ›„ ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•˜์—ฌ ๊ทธ ๊ณ„์ •์œผ๋กœ ์‹ค.

kingofbackend.tistory.com

 

์•„๋ž˜ ๋ช…๋ น์œผ๋กœ ๊ณ„์ • ๋ณ„ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์„ค์ •ํ•ด ์ค๋‹ˆ๋‹ค. auto ๋Š” ์ž๋™์œผ๋กœ ํŒจ์Šค์›Œ๋“œ๊ฐ€ ์ž…๋ ฅ ๋˜๋ฉฐ interactive๋Š” ๊ฐœ์ธ์ด ์ง์ ‘ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ž…๋ ฅ ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ ์ €๋Š” auto๋กœ ์„ค์ • ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

# /home/es/elasticsearch-7.13.4/bin/elasticsearch-setup-passwords auto

์•„๋ž˜์™€ ๊ฐ™์ด ํŒจ์Šค์›Œ๋“œ๊ฐ€ ์ž๋™ ์ž…๋ ฅ๋˜์–ด ํ‘œ์‹œ ๋ฉ๋‹ˆ๋‹ค. ์ถ”ํ›„ ์‚ฌ์šฉ์„ ์œ„ํ•ด ๊ผญ ์–ด๋”˜๊ฐ€์— ์ €์žฅํ•ด๋†“์Šต๋‹ˆ๋‹ค!

์ดํ›„ curl ๋ช…๋ น์œผ๋กœ id/passwd ์—†์ด ํ˜ธ์ถœ ํ•ด๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด error๊ฐ€ ๋ฐœ์ƒ ํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋Ÿผ ๋‹ค์‹œ ์„ค์ •ํ•œ id์™€ ํŒจ์Šค์›Œ๋“œ๋ฅผ ๋„ฃ๊ณ  ํ˜ธ์ถœ ํ•ด๋ด…๋‹ˆ๋‹ค. ํ˜ธ์ถœ ๋ฐฉ๋ฒ•์€ curl -u "id/passwd" localhost:9200 ์œผ๋กœ ํ˜ธ์ถœ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

์•„๋ž˜์™€ ๊ฐ™์ด id, passwd๋ฅผ ์ž…๋ ฅ ํ•˜๋ฉด ์ •์ƒ ํ˜ธ์ถœ ๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

profile on loading

Loading...