ElasticSearch license update

2020 업데이트!

** 현재는 kibana 에서 손쉽게 라이선스를 업데이트 할 수도 있으니 참고하세요 **
https://www.elastic.co/guide/en/kibana/current/managing-licenses.html

Elasticsearch를 운영 하면서 X-pack 에 포함되어 있는 Monitoring 이나 Devtool 등을 사용하면 얻을 수 있는 이점이 많습니다.
반가운 점은 기본적인 ** Basic license를 발급받아서 무료로 사용이 가능 ** 하다는 것 입니다.

# 1. Basic license 발급 받기

Elasticsearch 라이센스 발급 페이지 에서 회사 email 주소를 포함한 기본적인 정보를 입력하면 email로 다음 정보를 받을수 있습니다.

  • 라이센스 다운로드 링크
  • 라이센스 등록 가이드 링크

basic 라이센스는 max 100개의 노드에 사용 가능 하며 무료입니다.
기본적으로 Monotoring, Devtool 정도는 사용할 수 있고
자세한 사항은 subscription page 참고 하세요.

# 2. 발급받은 license를 cluster에 등록하기

1
2
3
4
5
6
7
8
9
10
To download your license, please go to:

--> http://license.elastic.co/registration/download/라이센스hash값

For license installation instructions:

Elasticsearch 6.x -- https://www.elastic.co/guide/en/x-pack/current/installing-license.html
Elasticsearch 5.x -- https://www.elastic.co/guide/en/x-pack/5.6/installing-license.html
Elasticsearch 2.x -- https://www.elastic.co/guide/en/marvel/current/license-management.html
Elasticsearch 1.x -- Use license code '1010' to register

메일 본문에 보면 위와 같은 내용이 들어 있습니다.
다운로드 링크를 누르면 2.X, 5.X이상의 라이센스를 선택해서 받을 수 있는 페이지로 연결 되고 json 파일로 된 라이센스 파일을 다운로드 받을 수 있습니다.
발급 받은 라이센스는 _license api 호출을 통해
등록 가능 합니다.

1
2
3
4
# 1.x
> curl -XPUT 'http://<host>:<port>/_licenses' -d @license.json
# 2.x
> curl -XPUT 'http://<host>:<port>/_license' -d @license.json

ES 1.x 와 2.x 는 _licenses_license의 단수/복수 차이만 있고 위에서 다운로드 받은 json 파일을 등록할 수 있습니다.


5.0 부터 xpack 에 포함되어 졌으므로 api 호출 주소도 _xpack/license 로 변경 되었고, Content-Type에 application/json 을 명시해 줘야 되는 점을 제외하면 기본적으로 등록 하는 방식은 이전 버전과 동일 합니다.

1
2
3
# 5.x 6.x
> curl -XPUT -u elastic 'http://<host>:<port>/_xpack/license' -H "Content-Type: application/json" -d @license.json

# License 연장 시 주의할 점

라이센스 연장 시 기존과 동일한 등급 (Basic to Basic, Platinum to Platinum 등 ) 이 아닌 다른 등급으로 새 라이센스를 받아서 등록하는 경우 아래와 같이 ** ?acknowledge=true ** 를 뒤에 붙여줘야 합니다.

1
2
3
4
# 2.x
> curl -XPUT 'http://<host>:<port>/_license?acknowledge=true' -d @license.json
# 5.x 6.x
> curl -XPUT -u elastic 'http://<host>:<port>/_xpack/license?acknowledge=true' -H "Content-Type: application/json" -d @license.json

# Tip: json 파일을 서버에 남기지 않고 License 등록 하기

Devtool (구 Sense)를 이용하여 바로 License를 등록 하고 싶거나 서버에 파일을 넣기 번거로운 경우 (운영계 VM에 접속하려면 절차가 복잡한 경우 등)
다운 받은 license 파일을 직접 열어서 등록 할 수 있습니다.

간단히 License파일을 열어서 전체 내용을 복사하고 request를 날리면 됩니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# devtool 5.x 기준
POST _xpack/license
{
"license": {
"uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
"type":"basic",
"issue_date_in_millis":1411948800000,
"expiry_date_in_millis":1914278399999,
"max_nodes":1,
"issued_to":"issuedTo",
"issuer":"issuer",
"signature":"xx"
}
}
Share