1HOON
논리적 코딩
1HOON
전체 방문자
오늘
어제
  • HOME (186)
    • ☕️ JAVA (28)
      • WhiteShip Java LIVE Study (6)
      • Effective JAVA (10)
    • 🔮 KOTLIN (4)
    • 🌱 SPRING (51)
      • 스프링 인 액션 (22)
      • JPA (18)
    • ☕️ JAVASCRIPT (6)
    • 📃 DATABASE (40)
      • ORACLE (37)
      • MSSQL (2)
    • 🐧 LINUX (4)
    • 🐳 DOCKER (5)
    • 🐙 KUBERNETES (4)
    • 🏗️ ARCHITECTURE (8)
    • 📦 ETC (26)
      • TOY PROJECT (5)
      • RECRUIT (1)
      • 그냥 쓰고 싶어서요 (14)
    • 🤿 DEEP DIVE (1)
    • 🚽 Deprecated (9)
      • PYTHON (3)
      • AWS (2)
      • HTTP 완벽가이드 (3)
      • WEB (1)

블로그 메뉴

  • 홈
  • 방명록
  • 관리

인기 글

최근 글

티스토리

hELLO · Designed By 정상우.
1HOON

논리적 코딩

[Elasticsearch] X-Pack Security 활성화 시 오류
📦 ETC

[Elasticsearch] X-Pack Security 활성화 시 오류

2022. 3. 15. 01:13

Elasticsearch 에서 보안 관련 기능을 사용하려면 X Pack Security를 활성화 해야합니다.

docker-compose.yml 에서는 xpack.security.enabled=true 로 X Pack Security를 활성화 할 수 있는데요, 활성화 후 컨테이너를 여러 차례 재기동하게 되면 아래와 같은 오류가 발생하고 Elasticsearch 노드가 종료되는 현상이 발생합니다.

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: Transport SSL must be enabled if security is enabled on a [basic] license. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/es-data-collector-cluster.log
{"type": "server", "timestamp": "2022-03-08T00:26:22,313Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-data-collector-cluster", "node.name": "es01", "message": "stopping ..." }
{"type": "server", "timestamp": "2022-03-08T00:26:22,335Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-data-collector-cluster", "node.name": "es01", "message": "stopped" }
{"type": "server", "timestamp": "2022-03-08T00:26:22,335Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-data-collector-cluster", "node.name": "es01", "message": "closing ..." }
{"type": "server", "timestamp": "2022-03-08T00:26:22,355Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-data-collector-cluster", "node.name": "es01", "message": "closed" }

이번 포스팅에서는 이 오류가 발생하는 이유와 해결 방법에 대해 다뤄보도록 하겠습니다.

 

 

원인


클러스터가 Security가 활성화되어 프로덕션 모드로 실행되면 Transport SSL이 반드시 활성화 되어야합니다. 반면에 30 days trial 라이선스로 실행된다면 TLS 설정은 필수가 아닙니다. 때문에 trial 라이선스가 만료될 경우 Transport SSL 설정이 요구되어 해당 오류가 발생한 것입니다.

 

 

해결 방법


오류 메시지대로 Transport SSL 설정을 하고, Elasticsearch 노드간 통신에 사용할 인증서를 생성해 배포해주면됩니다.

Transport SSL 설정

# X-PACK security 활성화
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
- xpack.security.transport.ssl.verification_mode=certificate
- xpack.security.transport.ssl.client_authentication=required 
- xpack.security.transport.ssl.keystore.path=certs/elastic-certificates.p12 
- xpack.security.transport.ssl.truststore.path=certs/elastic-certificates.p12

인증서 생성

  1. Elasticsearch 컨테이너를 구동하고 접속합니다.
    docker exec -it es01 /bin/bash
  2. CA 를 생성합니다.
    ./bin/elasticsearch-certutil ca
  3. Certificate 및 Private Key 를 생성합니다.
    ./bin/elasticsearch-certutil cert -- ca elastic-stack-ca.p12
  4. elastic-certificates.p12 파일을 복사해 다른 노드에도 배포합니다.

 

 

References


 

 

Bootstrap Checks | Elasticsearch Guide [7.16] | Elastic

Collectively, we have a lot of experience with users suffering unexpected issues because they have not configured important settings. In previous versions of Elasticsearch, misconfiguration of some of these settings were logged as warnings. Understandably,

www.elastic.co

 

License Management | Kibana Guide [7.16] | Elastic

If you are using a basic or trial license, security features are disabled by default. In all other licenses, security features are enabled by default; you must secure the Elastic Stack or disable the security features.

www.elastic.co

반응형
저작자표시 비영리 변경금지 (새창열림)

'📦 ETC' 카테고리의 다른 글

[Elasticsearch] 마스터노드 선출 실패 오류  (0) 2022.03.17
[Elasticsearch] vm.max_map_count 변경  (0) 2022.03.14
[Jenkins Blue Ocean] 젠킨스가 어려운 개발자를 위해  (0) 2021.08.28
[Swagger] Swagger를 이용해 API 문서를 자동으로 만들어보자  (1) 2020.11.05
[Swagger] API 명세도구를 사용해보자  (1) 2020.10.31
    '📦 ETC' 카테고리의 다른 글
    • [Elasticsearch] 마스터노드 선출 실패 오류
    • [Elasticsearch] vm.max_map_count 변경
    • [Jenkins Blue Ocean] 젠킨스가 어려운 개발자를 위해
    • [Swagger] Swagger를 이용해 API 문서를 자동으로 만들어보자
    1HOON
    1HOON

    티스토리툴바