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๋ฅผ ์ ๋ ฅ ํ๋ฉด ์ ์ ํธ์ถ ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.
'...' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Elastic Search+Java] ์ฌ์ฉ์ ์ธ์ฆ ๊ตฌํํ๊ธฐ Basic Authentication (0) | 2021.08.19 |
---|---|
[ElasticSearch] ElasticSearch ์ธ๋ถ ์ ์ํ๊ธฐ (0) | 2021.08.18 |
[Linux] CentOS 7์ OpenJDK 1.8 ์ค์นํ๊ธฐ (0) | 2021.08.18 |
[Kubernetes] nodeport, port, targetport ์ฐจ์ด (0) | 2021.08.17 |
[Linux] max user processes ๋๋ฆฌ๋ ๋ฐฉ๋ฒ (0) | 2021.08.17 |