Contents

Azure VM์— Elastic Stack ์„ค์ •

VM ์„ธํŒ…

๋ฆฌ์†Œ์Šค ๊ทธ๋ฃน ์ƒ์„ฑ

--location ์œผ๋กœ ๋ฆฌ์ ผ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋‹ค.

1
2
3
4
5
# ๋ฆฌ์ ผ ์ฝ”๋“œ ์กฐํšŒํ•˜๊ธฐ
az account list-locations -o table

# elastic Resource Group ์ƒ์„ฑ
az group create --name elastic --location koreasouth

VM ์ƒ์„ฑํ•˜๊ธฐ

elastic ๊ทธ๋ฃน์— VM ์„ ์ƒ์„ฑํ•œ๋‹ค.

1
2
3
4
5
6
yoon@Azure:~$ az vm create \
> --resource-group elastic \
> --name rileyVM \
> --image UbuntuLTS \
> --admin-username riley \
> --generate-ssh-keys

SSH ์ ‘์† ์„ธํŒ…

  • VM ์ƒ์„ฑ ์‹œ --generate-ssh-ke ์˜ ์˜ต์…˜์„ ์ฃผ์–ด SSH Key๋ฅผ ์ƒ์„ฑํ•˜์˜€๋‹ค.

SSH Private Key ๋‹ค์šด๋กœ๋“œ๋ฐฉ๋ฒ•

ํด๋ผ์šฐ๋“œ ์‰˜์„ ์‹คํ–‰ ํ›„ ๋ช…๋ น์–ด ์ฐฝ์— ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์„ ํƒํ•œ๋‹ค.

/.ssh/id_rsa PK ๊ฐ€ ์ €์žฅ๋œ ์œ„์น˜๋ฅผ ์ž…๋ ฅ ํ›„ ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ ํด๋ฆญํ•œ๋‹ค.

์ ‘์† ์‹œ private Key๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ ‘์†ํ•˜๋„๋ก ์„ค์ •ํ•œ๋‹ค.

  • Moba X Term
  • ~/.ssh/config ์„ค์ •
    1
    2
    3
    4
    5
    6
    
    Host riley-azure
      HostName {IP ์ฃผ์†Œ}
      User {์œ ์ €๋ช…}
      Port {SSH ํฌํŠธ}
      PreferredAuthentications publickey
      IdentityFile ~/.ssh/id_rsa_azure
    

VM์— Elasticsearch ์™€ Kibana ๋ฅผ ์„ค์น˜ํ•˜๊ธฐ

Elasticsearch, Kibana ๋ณด์•ˆ์„ค์ •ํ•˜๊ธฐ

Elasticsearch์™€ Kibana๋ฅผ ์™ธ๋ถ€์—์„œ๋„ ์ ‘๊ทผํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๋ณด์•ˆ ์„ค์ •์„ ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

Elasticsearch์™€ Kibana host ์„ค์ •

  • ์™ธ๋ถ€ IP๋กœ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•˜๋„๋ก host๋ฅผ 0.0.0.0 ๋กœ ์„ค์ •ํ•œ ํ›„ ๊ฐ๊ฐ ์„œ๋น„์Šค๋ฅผ restart ํ•œ๋‹ค.

elasticsearch.yml ์„ค์ •

  • /etc/elasticsearch/elasticsearch.yml
  • node.name์— ๋…ธ๋“œ ์ด๋ฆ„์„ ์ง€์–ด์ค€๋‹ค.
  • network.host: 0.0.0.0 ์œผ๋กœ ์„ค์ •ํ•ด์•ผ ์™ธ๋ถ€ IP์—์„œ ๋ฐฉํ™”๋ฒฝ์ด ์—ด๋ ค์žˆ๋Š” ๊ฒฝ์šฐ ์ ‘๊ทผ ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • cluster.initial_master_nodes: ["node-1"]
    • ์—˜๋ผ์Šคํ‹ฑ์„œ์น˜๋ฅผ ์—ฌ๋Ÿฌ๊ฐœ ๋Œ๋ฆด๊ฒฝ์šฐ ๊ฐ๊ฐ์˜ ๋…ธ๋“œ์ด๋ฆ„์„ ์ง€์ •ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.
 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- 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"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

kibana.yml ์„ค์ •

  • /etc/kibana/kibana.yml
  • server.host์— 0.0.0.0์œผ๋กœ ์„ค์ •ํ•ด์ค€๋‹ค.
1
2
3
4
5
6
7
# Kibana is served by a back end server. This setting specifies the port to use.
#server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "0.0.0.0"

Azure ์ธ๋ฐ”์šด๋“œ ์„ค์ •ํ•˜๊ธฐ

ํ™ˆ > ๊ฐ€์ƒ ๋จธ์‹  > {๊ฐ€์ƒ๋จธ์‹  ์ด๋ฆ„} > ์„ค์ • > ๋„คํŠธ์›Œํ‚น

ํŠน์ • IP์—์„œ๋งŒ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋„๋ก IP ์ถ”๊ฐ€ ์ง€์ •ํ•  ํฌํŠธ๊ฐ€ ์—ฌ๋Ÿฌ๊ฐœ์ธ ๊ฒฝ์šฐ , ๋กœ ์—ฌ๋Ÿฌ๊ฐœ๋ฅผ ๋‚˜์—ดํ•˜๋ฉด ๋œ๋‹ค.