본문 바로가기
개발 관련

elasticsearch(엘라스틱 서치) 첫 시작 튜토리얼이자 매뉴얼

by 더블와이 2025. 3. 18.
728x90

회사에서 엘라스틱 서치 관련해서 일 시작할거라고 공부하라고 하셔서 이것저것 찾아보며 엘라스틱서치 설치를 끝내고 키바나 실행까지 완료하였다!

1. 엘라스틱 서치 설치(다운로드)

https://www.elastic.co/kr/downloads/elasticsearch

 

Download Elasticsearch

Download Elasticsearch or the complete Elastic Stack (formerly ELK stack) for free and start searching and analyzing in minutes with Elastic....

www.elastic.co

윈도우 버전으로 다운로드 하였다

다운로드 경로로 다운받으면 경로가 길어서 그런지 다운로드가 잘 안돼서 C드라이브로 옮겨주었다

C:\elasticsearch-8.17.3

 

25년 3월 기준으로 8.17.3 버전을 다운로드 받았다

+ zip 파일이라 압축을 풀어주어야함

2. elasticsearch 배치파일 실행

C:\elasticsearch-8.17.3\elasticsearch-8.17.3\bin 경로에 있는 elasticsearch > 유형: 배치 파일 > 오른쪽 마우스 > 관리자 권한으로 실행

혹은 cmd 창을 띄워서 해당 경로로 이동하여(cd C:\elasticsearch-8.17.3\elasticsearch-8.17.3\bin) elasticsearch.bat으로 실행하면 된다

그럼 어쩌고 저쩌고 loaded module , starting ...등 뜸

 

3. 관리자 계정 생성

C:\elasticsearch-8.17.3\elasticsearch-8.17.3\bin 경로 > elasticsearch-users useradd @@ (@@이라는 계정을 생성하고 패스워드를 입력한다)

그렇다면.. 관리자용 권한을 줘야할텐데

elasticsearch-users roles @@ -a apm_user

apm_user 권한 생성

elasticsearch-users roles @@ -a kibana_system

키바나 시스템에 권한을 생성한다

4. 키바나 접속용 계정 생성

C:\elasticsearch-8.17.3\elasticsearch-8.17.3\bin 경로 > elasticsearch-users useradd marie(marie라는 계정을 생성하고 패스워드 생성까지 마친 후 권한 설정을 해주어야한다)

elasticsearch-users roles marie -a kibana_admin

marie 라는 계정에 kibana_admin이라는 권한을 준다는 뜻!

 

https://www.elastic.co/guide/en/elasticsearch/reference/current/built-in-roles.html

 

Built-in roles | Elasticsearch Guide [8.17] | Elastic

Using the Transport Client effectively means the users are granted access to the cluster state. This means users can view the metadata over all indices, index templates, mappings, node and basically everything about the cluster. However, this role does not

www.elastic.co

▲ 권한관련 공식 사이트

 

5. localhost:9200 실행

http://localhost:9200/

 

{
  "name" : "@@",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "@@",
  "version" : {
    "number" : "8.17.3",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "@@",
    "build_date" : "2025-02-28T10:07:26.089129809Z",
    "build_snapshot" : false,
    "lucene_version" : "9.12.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

 

이제 키바나 설치를 하러 가야겠다

to be continued...

 

728x90