๊ธ€ ์ž‘์„ฑ์ž: ๋˜ฅํด๋ฒ .
๋ฐ˜์‘ํ˜•

๊ฐœ์š”


 ๊ธฐ๋ณธ์ ์ธ ์„ค์ • ๊ฐ’์œผ๋กœ๋Š” Elastic Search API๋ฅผ ์ž๊ธฐ ์ž์‹ ์˜ ํ˜ธ์ŠคํŠธ(loop back address: 127.0.0.1)์—์„œ๋งŒ ์‚ฌ์šฉ ํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ธํŒ…๋˜์–ด์žˆ๋‹ค.

 

 ๊ณต์‹ ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ์—์„œ๋Š” ๊ฐœ๋ฐœ์šฉ ํ…Œ์ŠคํŠธ ์„œ๋ฒ„๋กœ Elastic Search๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ์—๋Š” 127.0.0.1๋กœ host๋ฅผ ์„ค์ •ํ•ด๋„ ๋ฌด๋ฆฌ๊ฐ€ ์—†๋‹ค๊ณ  ๋‚˜์™€์žˆ์ง€๋งŒ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒฝ์šฐ์— ํ˜ธ์ŠคํŠธ ์ฃผ์†Œ๋ฅผ ๋ฐ”๊พธ์–ด ์ค„ ํ•„์š”๊ฐ€ ์žˆ๋‹ค.

 

  • VMํ™˜๊ฒฝ์—์„œ Elastic Search๋ฅผ ์„ค์น˜ํ•˜๊ณ  ์™ธ๋ถ€์—์„œ VM Elastic Search์— ์ ‘๊ทผํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒฝ์šฐ
  • ์ƒ์šฉ ์„œ๋น„์Šค๋ฅผ ์šด์˜ํ•  ๊ฒฝ์šฐ

 

์„ค์ •


์„ค์ •์€ ๊ฐ„๋‹จํ•˜๋‹ค. ์ž์‹ ์˜ Elastic Search ์„ค์ • ํด๋”์˜ elasticsearch.yml๋ฅผ ์—ฐ๋‹ค.

ํ•„์ž์˜ ๊ฒฝ์šฐ /etc/elasticsearch/elasticsearch.yml (Elastic Search๋ฅผ ์–ด๋–ป๊ฒŒ ์„ค์น˜ํ–ˆ๋Š๋ƒ์— ๋”ฐ๋ผ ๋‹ค๋ฅด๋‹ค)
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
...
...
...
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["127.0.0.1"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1"]
node.name ์ž์‹ ์˜ ๋…ธ๋“œ ์ด๋ฆ„(์‚ฌ์šฉ์ž ๋งˆ์Œ๋Œ€๋กœ)
network.host 0.0.0.0
http.port 9200(Elastic Search ๊ธฐ๋ณธ ํฌํŠธ)
discover.seed_hosts ["127.0.0.1"]
cluster.initial_master_nodes ["์ž์‹ ์˜ ๋…ธ๋“œ ์ด๋ฆ„"]

 

network.host ์ฃผ์†Œ๋ฅผ loopback address๊ฐ€ ์•„๋‹Œ ๋‹ค๋ฅธ ์ฃผ์†Œ๋กœ ๋ฐ”๊พธ๋ฉด Development mode์—์„œ Production mode๋กœ ์ธ์‹ํ•˜๋Š”๋ฐ, 

Production mode์—์„œ๋Š” discover.seed_hosts, cluster.initial_master_nodes์™€ ๊ฐ™์€ ์„ค์ •์„ ์ฃผ์„ ํ•ด์ œํ•˜์—ฌ ๋”ฐ๋กœ ์„ค์ •ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

 

์„ค์ •์„ ๋งˆ์ณค์œผ๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด Elastic Search๋ฅผ ์žฌ์‹œ์ž‘ํ•œ๋‹ค.

 

$sudo service elasticsearch restart

 

์ฐธ๊ณ ์ž๋ฃŒ


https://www.elastic.co/guide/en/elasticsearch/reference/7.3/network.host.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.3/system-config.html#dev-vs-prod
๋ฐ˜์‘ํ˜•