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

 

์„œ๋ฒ„๋Š” CentOS7 ๊ธฐ์ค€์ž…๋‹ˆ๋‹ค.

 

Elastic Search๋Š” JVM์—์„œ ๋Œ์•„๊ฐ€๊ธฐ ๋•Œ๋ฌธ์— 1.8 ์ด์ƒ์˜ JDK๊ฐ€ ์„ค์น˜๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. JDK๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋˜์—ˆ๋‹ค ๊ฐ€์ •ํ•˜๊ฒŒ ์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

[STEP1] Elastic Search repo ํŒŒ์ผ ์ƒ์„ฑ

$ vi /etc/yum.repos.d/elasticsearch.repo

repo ํŒŒ์ผ์„ ์ƒ์„ฑ ํ›„ elasticsearch.repo์— ์•„๋ž˜์™€ ๊ฐ™์€ ๋‚ด์šฉ์„ ์ ์Šต๋‹ˆ๋‹ค.

 

* ์ฐธ๊ณ  : yum์ด ์•„๋‹Œ tar.gz ๋กœ ๋‹ค์šด๋ฐ›๊ณ  ์‹ถ์œผ์‹  ๋ถ„๋“ค์€ ์•„๋ž˜ ๋งํฌ๋ฅผ ํ™•์ธํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

Install Elasticsearch from archive on Linux or MacOS | Elasticsearch Guide [7.14] | Elastic

Typically, any cluster-wide settings (like cluster.name) should be added to the elasticsearch.yml config file, while any node-specific settings such as node.name could be specified on the command line.

www.elastic.co

 

[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

[STEP2] yum์œผ๋กœ ์„ค์น˜

$ yum install -y elasticsearch

๋ช…๋ น์–ด ๋’ค์— ๋ฒ„์ „์„ ๋ช…์‹œํ•˜์ง€ ์•Š์œผ๋ฉด ์ตœ์‹ ๋ฒ„์ „์œผ๋กœ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค. ๋ฒ„์ „์„ ๋ช…์‹œํ•˜๋ ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

$ yum install -y elasticsearch-7.13.4

 ์„ค์น˜๋ฅผ ํ•˜๊ฒŒ๋˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ๋””๋ ‰ํ„ฐ๋ฆฌ๊ฐ€ ์ƒ๊น๋‹ˆ๋‹ค.

 

home dir : /usr/share/elasticsearch
config dir : /etc/elasticsearch
data dir : /var/lib/elasticsearch
log dir : /var/log/elasticsearch


[STEP3] ์„œ๋น„์Šค ๋“ฑ๋ก

$ sudo systemctl enable elasticsearch
$ sudo systemctl start elasticsearch

 

[FINAL STEP] ์„ค์น˜ ํ™•์ธ

 

์œ„์™€ ๊ฐ™์ด ์„œ๋น„์Šค๋กœ ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๊ณ , /usr/share/elasticsearch/bin ์œผ๋กœ ์ด๋™ ํ›„ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•œ ํ›„ Elastic Search๋ฅผ ์‹คํ–‰์‹œํ‚ค๊ธฐ๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

$ ./elasticsearch

 

๋งŒ์•ฝ ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค๋ฉด ์•„๋ž˜ ๊ธ€์„ ์ฐธ์กฐํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

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

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

kingofbackend.tistory.com

 

์‹คํ–‰ํ•œ ํ›„ ์•„๋ž˜์™€ ๊ฐ™์ด ํ•ฉ๋‹ˆ๋‹ค. localhost ๋Œ€์‹  ์„œ๋ฒ„ ip๋ฅผ ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค.

$ curl -X GET 'localhost:9200'

์ž…๋ ฅ ํ›„ ์•„๋ž˜์™€ ๊ฐ™์ด ๋‚˜์˜จ๋‹ค๋ฉด ์ •์ƒ์ ์œผ๋กœ ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

{
  "name" : "es-install-test",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "6IfgGaPUHTHu_JfzfEgRVw",
  "version" : {
    "number" : "7.6.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "7f634e9f12345fbc12721234dd1da681b0c3b1e3",
    "build_date" : "2020-02-06T00:09:00.449973Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

profile on loading

Loading...