'2019/07'에 해당되는 글 3건

  1. 2019.07.30 [Elasticsearch] Network Bandwidth 설정 튜닝
  2. 2019.07.30 [Elasticsearch] GC 설정 튜닝
  3. 2019.07.11 [Elasticsearch] Shard reroute (6.x)

[Elasticsearch] Network Bandwidth 설정 튜닝

Elastic/Elasticsearch 2019. 7. 30. 16:14

설정 튜닝이라고는 했으나 문서 하나의 크기가 클 경우 꼭 검토 및 활용 하시면 도움이 되는 옵션 입니다.

 

원문)

https://www.elastic.co/guide/en/elasticsearch/reference/7.2/modules-transport.html

transport.compress

Set to true to enable compression (DEFLATE) between all nodes. Defaults to false.

 

https://www.elastic.co/guide/en/elasticsearch/reference/7.2/modules-http.html

http.compression

Support for compression when possible (with Accept-Encoding). Defaults to true.

http.compression_level

Defines the compression level to use for HTTP responses. Valid values are in the range of 1 (minimum compression) and 9 (maximum compression). Defaults to 3.

 

자, 그럼 여기서 부터 부연 설명 들어 갑니다.

 

transport 설정은 tcp 통신 시 사용이 되고, http 설정은 잘 아시는 바와 같이 http 통신 시 사용이 됩니다.

여기서 주의 하실 점, 하나!!

Client 에서 RESTful API 를 이용해서 Elasticsearch 로 Request 보내 실 경우 반드시 http header 에 "gzip encoding" 설정을 하시고 Request 를 보내셔야 합니다.

 

더보기

Accept-Encoding: gzip, deflate

transport.tcp.compress: true
http.compression: true
http.compression_level: 3

:

[Elasticsearch] GC 설정 튜닝

Elastic/Elasticsearch 2019. 7. 30. 15:59

일부 6.x 버전을 사용하고 있는 클러스터가 있어서 GC 튜닝 설정 좋은 글이 있어 링크 공유 합니다.

 

https://medium.com/naukri-engineering/garbage-collection-in-elasticsearch-and-the-g1gc-16b79a447181

 

Garbage Collection in Elasticsearch and the G1GC - Naukri Engineering - Medium

Impact of Garbage collection in Elasticsearch and using the G1GC instead of the default CMS GC.

medium.com

이 글은 2018년 10월에 작성 된 글인데 읽어 보시고 적용해 보시면 확실히 개선 효과를 얻으실 수 있습니다.

 

구성된 클러스터에서 몇 가지 특징이 있는데 모든게 다 그렇지만 딱 들어 맞는건 어디에도 없습니다.

환경에 맞춰서 수정 하시고 적용 하셔야 낭패 보는 일이 없습니다.

 

...더보기

-XX:+UseG1GC
-XX:MaxGCPauseMillis=300
-XX:G1HeapRegionSize=16m

 

:

[Elasticsearch] Shard reroute (6.x)

Elastic/Elasticsearch 2019. 7. 11. 13:29

공식문서)

https://www.elastic.co/guide/en/elasticsearch/reference/7.2/cluster-reroute.html

 

Cluster Reroute | Elasticsearch Reference [7.2] | Elastic

The reroute command allows for manual changes to the allocation of individual shards in the cluster. For example, a shard can be moved from one node to another explicitly, an allocation can be cancelled, and an unassigned shard can be explicitly allocated

www.elastic.co

 

6.x 와 7.x 간에 차이 없이 사용 하실 수 있습니다.

 

POST _cluster/reroute
{
  "commands": [
    {
      "allocate_replica": {
        "index": "actlog-2019-07-05",
        "shard": 0,
        "node": "노드명"
      }
    }
  ]
}

POST _cluster/reroute
{
  "commands": [
    {
      "move": {
        "index": "actlog-2018-12-27",
        "shard": 0,
        "from_node": "노드명1",
        "to_node": "노드명2"
      }
    }
  ]
}

공식 문서에 설명이 잘 나와 있어서 제가 특별히 설명을 하지 않아도 될 것 같습니다.

 

move)

started shard 에 대해서 가능 합니다.

 

allocate_replica)

unassigned replica shard 에 대해서 가능 합니다.

 

이번에 제가 사용하게 된 이유는 데이터 노드 3개 중에 하나의 노드의 disk 가 85% 를 넘어서 replica shard 가 unassigned 되는 문제가 발생을 했습니다.

그래서 수동으로 임시 조치 하기 위해 reroute 했고요.

근본적인 해결 방법은 disk 용량을 확보 하시는 것입니다. 또는 85% 가 넘지 않도록 rolling 하시면 됩니다.

: