본문 바로가기

Programming/[elasticsearch]

[elasticsearch] elasticsearch 설치

1. elasticsearch란?

- 속도와 확장성, 그리고 수많은 종류의 콘텐츠를 검색

  • 속도
  • 분산
  • 다양한 기능
  • 데이터  수집, 시각화, 보고 간소화

- 사용자는 이 데이터에 대해 복잡한 쿼리를 실행하고 집계를 사용해 데이터의 복잡한 요약을 검색가능

 

2. elasticsearch 설치

URL - https://www.elastic.co/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

설치 후 원하는 경로에 압축 풀기

 

 

3. elasticsearch 실행

CMD 실행 후 elasticsearch의 디렉토리의 bin 폴더로 이동 후 아래 명령어 실행

 

elasticsearch.bat

이렇게만 하면 정상 실행된다는 포스팅이 많았으나 필자는 정상 동작하지 않았음

 

elasticsearch-8.0.0\config 폴더로 이동운 elasticsearch.yml 파일 편집

 

network.host: 127.0.0.1
xpack.security.http.ssl.enabled: false # http 환경이기에 https 설정을 off
 

다시 elasticsearch.bat를 실행

 

localhost:9200으로 브라우저에서 열었고 userId와 password를 입력하는 alert창이 표시됨

 

기본적으로 id : elastic / password : changeme 로 되어있다는데

 

필자의 컴퓨터에는 해당 계정이 존재하지 않음

 

elasticsearch-8.0.0\bin 경로로 이동

elasticsearch-users useradd admin -p 111111 -r superuser

 

role을 추가하는 것에서 계속 애를 먹었고 role mapping에 실패하여 superuser라는 기존 elastic계정의 권한을 입력함

 

다시 elasticsearch.bat 재실행 후 브라우저에서 localhost:9200으로 접속하여

 

admin / 111111로 로그인

 

 

해당 화면이 표시되면 정상적으로 elasticsearch가 실행된 것