8. rolling upgrades

minor version(5.x -> 5.y) 변경시 cluster내 node를 1대씩 upgrade 진행


1) Disable shard allocation

작업 node를 disable 하기전에 아래 명령어를 수행

(해당 노드에 데이터를 다른 노드로 replication 되는 것을 방지)


curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d'

{

  "transient": {

    "cluster.routing.allocation.enable": "none"

  }

}

'


2) Stop non-essential indexing and perform a synced flush (Optional)

덜 중요한 indexing 작업을 중단하고 데이터에 대한 disk flush 수행


curl -XPOST 'localhost:9200/_flush/synced?pretty'



3) Stop and upgrade a single node

- 새로운 버전을 새로운 디렉토리에 unzip

- 기존 config, data 디렉토리를 새로운 디렉토리로 복사

- jvm.options 및 elasticsearch.yml 파일을 새로운 디렉토리로

  수정

- plugin upgrade 수행 (elasticsearch-plugin script 수행)



4) Start the upgraded node


작업 노드를 시작후 log 및 아래 커맨드로 상태 체크

curl -XGET 'localhost:9200/_cat/nodes?pretty'



5) Reenable shard allocation

작업 노드에 데이터 복제를 수행하기 위해 아래 커맨드 수행

curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d'

{

  "transient": {

    "cluster.routing.allocation.enable": "all"

  }

}

'


6) Wait for the node to recover

다음 노드를 upgrade하기전 현재 노드에 대한 복제 진행 상태가 완료되었는지 아래 명령어로 체크

(yellow에서 green으로 상태가 변경되면 모든 primary/replica shards가 정상, 신규 버전에 데이터는

 old 버전의 노드로 복제되지 않음으로 신규 버전으로 빠른시간안에 upgrade해야함)


curl -XGET 'localhost:9200/_cat/health?pretty'



7) recovery 진행 상태 확인

sync-flused 수행하지 않으면 일정 시간동안 recovery 하며, 아래 명령어로 확인 가능


curl -XGET 'localhost:9200/_cat/recovery?pretty'


8) 위에 작업을 다른노드에 repeat



'NoSQL > Elasticsearch' 카테고리의 다른 글

x-pack 란  (0) 2017.03.22
[설치] elk 5.2.2 full cluster restart upgrade  (0) 2017.03.20
[설치] elk 5.2.2 config 설정  (0) 2017.03.20
[설치] elk 5.2.2 설치 상태 확인  (0) 2017.03.20
[설치] elk 5.2.2 start/stop  (0) 2017.03.20

+ Recent posts