Skip to content
Cluster Edition 업그레이드

Cluster Edition 업그레이드

Coordinator 업그레이드

Coordinator / Deployer는 수동으로 업그레이드해야 합니다.

주의 사항

  • 업그레이드 중에는 노드 추가 / 시작 / 종료 / 삭제와 같은 명령을 실행할 수 없습니다.
  • DDL 또는 DELETE가 실행 중이면 안 됩니다. (INSERT, APPEND, SELECT는 실행해도 됩니다.)

Coordinator 종료

Coordinator / Deployer를 종료해도 Broker / Warehouse의 INSERT, APPEND, SELECT에는 영향을 주지 않습니다.

다만 Coordinator / Deployer가 종료된 동안에는 Broker / Warehouse가 종료되어도 이를 감지하지 못합니다. (일반적으로 재시작한 뒤에 감지합니다.)

machcoordinatoradmin --shutdown

Coordinator 백업 (선택 사항)

$MACHBASE_COORDINATOR_HOME에 있는 dbs/ 및 conf/ 디렉터리를 백업합니다.

Coordinator 업그레이드

  • 경량 패키지가 아닌 전체 패키지를 사용합니다.

패키지를 $MACHBASE_COORDINATOR_HOME에 압축 해제하여 기존 파일을 덮어씁니다.

tar zxvf machbase-ent-new.official-LINUX-X86-64-release.tgz -C $MACHBASE_COORDINATOR_HOME

Coordinator 시작

machcoordinatoradmin --startup

Deployer 업그레이드

Coordinator와 절차가 같습니다.

주의 사항

  • 업그레이드 중에는 노드 추가 / 시작 / 종료 / 삭제와 같은 명령을 실행할 수 없습니다.

Deployer 종료

machdeployeradmin --shutdown

Deployer 백업 (선택 사항)

$MACHBASE_DEPLOYER_HOME에 있는 dbs/ 및 conf/ 디렉터리를 백업합니다.

Deployer 업그레이드

  • Deployer가 설치된 호스트에서 MWA 또는 Collector를 실행하지 않는다면 경량 패키지를 사용해도 됩니다.

패키지를 $MACHBASE_DEPLOYER_HOME에 압축 해제하여 기존 파일을 덮어씁니다.

tar zxvf machbase-ent-new.official-LINUX-X86-64-release.tgz -C $MACHBASE_DEPLOYER_HOME

Deployer 시작

machdeployeradmin --startup

패키지 등록

Broker / Warehouse를 업그레이드하려면 Coordinator에 패키지를 등록한 뒤 업그레이드를 진행합니다.

경량 패키지를 등록하는 것을 권장합니다.

먼저 $MACHBASE_COORDINATOR_HOME이 있는 호스트로 패키지를 옮깁니다.

그런 다음 아래 명령으로 패키지를 추가합니다.

machcoordinatoradmin --add-package=new_package --file-name=./machbase-ent-new.official-LINUX-X86-64-release-lightweight.tgz
옵션설명
–add-package추가할 패키지 이름을 지정합니다.
–file-name추가할 패키지 파일의 경로를 지정합니다.
이미 추가된 패키지와 파일 이름이 같으면 오류가 발생하므로 파일 이름을 확인하십시오.

Broker/Warehouse 업그레이드

Coordinator에서 다음 명령을 실행합니다.

노드 종료

machcoordinatoradmin --shutdown-node=localhost:5656

노드 업그레이드

machcoordinatoradmin --upgrade-node=localhost:5656 --package-name=new_package
옵션설명
–upgrade-node업그레이드할 노드의 이름을 지정합니다.
–package-name업그레이드에 사용할 패키지의 이름을 지정합니다.
  • 노드를 종료하지 않은 상태에서 업그레이드하면 노드를 자동으로 종료한 뒤 업그레이드합니다. 다만 안정성을 위해 업그레이드 전에 노드를 명시적으로 종료하십시오.

노드 시작

machcoordinatoradmin --startup-node=localhost:5656

Snapshot Failover

Snapshot Failover는 Machbase 6.5 Cluster Edition부터 사용할 수 있습니다.

Snapshot failover는 DBMS가 정상 상태일 때 스냅샷을 기록해 두고, 특정 warehouse에 장애가 발생하면 정상 스냅샷 이전 데이터를 제외하고 문제가 발생한 부분에 대해서만 failover를 수행해 빠르게 복구하는 기능입니다.

Snapshot 기본 개념

Cluster Edition의 그룹마다, 그룹 내 warehouse들의 데이터가 어디까지 정상인지 그 위치를 기록합니다.

그룹 내 warehouse에서 생성된 스냅샷 이전의 데이터는 모두 정상 상태이며, 스냅샷은 그룹 단위로 기록됩니다.

Snapshot Failover 작동 방식

특정 warehouse에 문제가 발생하면 해당 warehouse는 scrapped 상태로 전환되며, 데이터를 복구해야 합니다.

Snapshot Recovery를 수행하면 문제가 발생한 warehouse에서 정상 스냅샷 이후의 데이터를 지웁니다. 이어서 같은 그룹의 정상 warehouse에서 기준 스냅샷 이후의 데이터를 문제가 발생한 warehouse로 복제하면 복구가 완료됩니다.

자동 스냅샷 실행

자동 스냅샷 실행은 기본으로 활성화되어 있으며, 실행 간격은 60초입니다. 클러스터에 warehouse 그룹이 여러 개 있으면 스냅샷 간격마다 한 그룹씩 차례로 스냅샷을 수행합니다.

실행 간격을 0으로 설정하면 자동 스냅샷 실행이 비활성화됩니다.

스냅샷 간격 설정은 명령을 실행하는 즉시 반영됩니다.

## 스냅샷 간격 설정
machcoordinatoradmin --snapshot-interval=[sec]

## 현재 스냅샷 간격 확인
machcoordinatoradmin --configuration

수동으로 스냅샷 생성

machcoordinatoradmin 도구에서 group_name을 지정해 수동으로 스냅샷을 수행합니다.

group_name은 group1, group2처럼 미리 정해진 그룹 이름입니다.

클러스터에 그룹이 여러 개 있으면, 전체 스냅샷을 만들기 위해 그룹마다 스냅샷을 수행해야 합니다.

## group_name에 대해 수동으로 스냅샷 생성
machcoordinatoradmin --exec-snapshot --group='group_name'

스냅샷을 기반으로 scrapped 노드 복구

scrapped 노드가 발생하면 다음과 같이 복구합니다.

## 그룹 상태를 readonly로 변경
## 이후 단계에서 그룹이 normal 상태로 변경되는 것을 방지
machcoordinatoradmin --set-group-state=readonly --group=[groupname]

## 스냅샷을 기반으로 복구
machcoordinatoradmin --snapshot-recover=[nodename]

## 복제를 통해 스냅샷 이후의 최신 데이터 복제
## 복제가 완료되면 warehouse의 상태가 자동으로 normal로 변경됩니다.
machcoordinatoradmin --exec-sync=[nodename]

## 그룹 상태를 normal로 변경
machcoordinatoradmin --set-group-state=normal --group=[groupname]

스냅샷 기반 scrapped 노드 복구 과정

스냅샷으로 scrapped 노드를 복구하면 다음 과정이 진행됩니다.

/* Initial cluster state */
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30420 | group1          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
/* warehouse 0 of group1 dies */
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | scrapped      | **unknown**   | ----------- |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | ----------- |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
## Change the group state to readonly
machcoordinatoradmin --set-group-state=readonly --group=[groupname]
  
kellen@kellen-ku:~$ machcoordinatoradmin --set-group-state=readonly --group=group1
-------------------------------------------------------------------------
     Machbase Coordinator Administration Tool
     Release Version - 321a012d05.develop
     Copyright 2014, MACHBASE Corp. or its subsidiaries
     All Rights Reserved
-------------------------------------------------------------------------
Group Name: group1
Flag      : 1
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | scrapped      | **unknown**   | ----------- |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | ----------- |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
## Restart the dead warehouse
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | scrapped      | scrapped      | ----------- |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | ----------- |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
## Recovery based on snapshot
machcoordinatoradmin --snapshot-recover=[nodename]
  
kellen@kellen-ku:~$ machcoordinatoradmin --snapshot-recover=localhost:30410
-------------------------------------------------------------------------
     Machbase Coordinator Administration Tool
     Release Version - 321a012d05.develop
     Copyright 2014, MACHBASE Corp. or its subsidiaries
     All Rights Reserved
-------------------------------------------------------------------------
Node-Name: localhost:30410
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | scrapped      | scrapped      | ----------- |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | ----------- |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
## Replicate the latest data after snapshot through replication
machcoordinatoradmin --exec-sync=[nodename]
  
kellen@kellen-ku:~$ machcoordinatoradmin --exec-sync=localhost:30410
-------------------------------------------------------------------------
     Machbase Coordinator Administration Tool
     Release Version - 321a012d05.develop
     Copyright 2014, MACHBASE Corp. or its subsidiaries
     All Rights Reserved
-------------------------------------------------------------------------
Node-Name: localhost:30410
Source:
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | scrapped      | scrapped      | stopped     |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | stopped     |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | sync-standby  | sync-standby  | running     |
| warehouse   | localhost:30420 | group1          | readonly        | sync-active   | sync-active   | running     |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | readonly        | normal        | normal        | stopped     |
| warehouse   | localhost:30420 | group1          | readonly        | normal        | normal        | stopped     |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
  
## Change the group state to normal
machcoordinatoradmin --set-group-state=normal --group=[groupname]
  
kellen@kellen-ku:~$ machcoordinatoradmin --set-group-state=normal --group=group1
-------------------------------------------------------------------------
     Machbase Coordinator Administration Tool
     Release Version - 321a012d05.develop
     Copyright 2014, MACHBASE Corp. or its subsidiaries
     All Rights Reserved
-------------------------------------------------------------------------
Group Name: group1
Flag      : 0
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
|  Node Type  |    Node Name    |   Group Name    |   Group State   |    Desired & Actual State     |  RP State   |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+
| coordinator | localhost:30110 | Coordinator     | normal          | primary       | primary       | ----------- |
| coordinator | localhost:30120 | Coordinator     | normal          | normal        | normal        | ----------- |
| deployer    | localhost:30210 | Deployer        | normal          | normal        | normal        | ----------- |
| broker      | localhost:30310 | Broker          | normal          | leader        | leader        | ----------- |
| broker      | localhost:30320 | Broker          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30410 | group1          | normal          | normal        | normal        | stopped     |
| warehouse   | localhost:30420 | group1          | normal          | normal        | normal        | stopped     |
| warehouse   | localhost:30510 | group2          | normal          | normal        | normal        | ----------- |
| warehouse   | localhost:30520 | group2          | normal          | normal        | normal        | ----------- |
+-------------+-----------------+-----------------+-----------------+-------------------------------+-------------+

스냅샷 관련 프로퍼티

프로퍼티설명적용 위치
GROUP_SNAPSHOT_TIMEOUT_SEC스냅샷 실행 시 타임아웃 시간
기본값 : 60 (초)
최소값 : 0 (무한 대기)
최대값 : uint32_max (초)
각 노드의 machbase.conf 파일에 설정
최근 업데이트