- Kubernetesオペレータ・ユーザーズ・ガイド
- アップグレードの実行
- レプリケートされたTimesTenClassicオブジェクトの自動アップグレードの実行
レプリケートされたTimesTenClassicオブジェクトの自動アップグレードの実行
自動アップグレードを開始する前に、次の点に注意してください:
ノート:
自動アップグレードはすぐに実行されます。TimesTenオペレータは、データベースを停止し、再起動してから、フェイルオーバー・プロセスを開始して完了します。本番日の最も忙しい時間にこの手順を実行しないでください。アップグレード手順の結果として、アプリケーションは短期間停止され、パフォーマンスが低下する場合もあります。
レプリケートされたTimesTenClassicオブジェクトの自動アップグレードを実行します。
- ネームスペースで実行されているTimesTenClassicオブジェクトを確認します。
kubectl get ttc
出力は、次のようになります。
NAME STATE ACTIVE AGE mannorepsample AllReplicasReady N/A 30h manrepsample Normal manrepsample-0 54m norepsample AllReplicasReady N/A 21h repsample Normal repsample-0 50m
ネームスペースで実行されているTimesTenClassicオブジェクトがいくつかあります。レプリケートされたTimesTenClassicオブジェクトの1つが
repsample
です。高レベル状態はNormal
で、アクティブ・スタンバイ・ペアのTimesTenデータベースが稼働中であり、正しく機能していることを示します。 - オブジェクトのイメージ・アップグレード・ストラテジを確認します。
kubectl get ttc repsample -o yaml | grep imageUpgradeStrategy
出力は次のようになります。
imageUpgradeStrategy: Auto
イメージ・アップグレード・ストラテジは
Auto
(デフォルト)で、自動アップグレード・ストラテジを示します。 - 開発ホストで、アップグレードに使用するコンテナ・イメージを使用して、TimesTenClassicオブジェクトの
.spec.ttspec.image
データ項目を編集します。この例では、container-registry.oracle.com/timesten/timesten:22.1.1.28.0
を使用します。- ファイルを編集し、
image
値をcontainer-registry.oracle.com/timesten/timesten:22.1.1.28.0
に置き換えます。kubectl edit ttc repsample # Please edit the object below. Lines beginning with a '#' will be ignored, # and an empty file will abort the edit. If an error occurs while saving this file will be # reopened with the relevant failures. # apiVersion: timesten.oracle.com/v2 kind: TimesTenClassic ... image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0 ...
- ファイルを保存して、エディタを終了します。
- ファイルを編集し、
- StatefulSetに新しいイメージが含まれていることを確認します。
kubectl describe statefulset repsample | grep Image
出力は次のようになります。
Image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.28.0
TimesTenオペレータは、TimesTenClassicの
.spec.ttspec.image
データ項目への更新があることを検出すると、新しいイメージでStatefulSetを変更します。これはレプリケートされたTimesTenClassicオブジェクトの自動アップグレードであるため、TimesTenオペレータは処理を実行し、アップグレード・プロセスを開始および調整します。 - アップグレードの進行状況を監視し、状態遷移を監視します。
kubectl get events -w
出力は、次のようになります。
LAST SEEN TYPE REASON OBJECT MESSAGE ... 8m4s Normal Upgrade timestenclassic/repsample Image updated, automatic upgrade started 8m4s Normal Upgrade timestenclassic/repsample Deleted standby pod repsample-1 during upgrade 7m59s Warning Failed timestenclassic/repsample Pod repsample-1 was replaced 7m54s Normal StateChange timestenclassic/repsample Pod repsample-1 is Not Ready 7m54s Warning StateChange timestenclassic/repsample TimesTenClassic was Normal, now ActiveTakeover 7m53s Normal StateChange timestenclassic/repsample TimesTenClassic was ActiveTakeover, now StandbyDown 5m28s Normal Info timestenclassic/repsample Pod repsample-1 Agent Up 5m28s Normal Info timestenclassic/repsample Pod repsample-1 Instance Exists 5m28s Normal Info timestenclassic/repsample Pod repsample-1 Daemon Down 5m28s Normal Info timestenclassic/repsample Pod repsample-1 Daemon Up 5m28s Normal Info timestenclassic/repsample Pod repsample-1 Database Unloaded 5m25s Normal Info timestenclassic/repsample Pod repsample-1 Database None 5m10s Normal Info timestenclassic/repsample Pod repsample-1 Database Loaded 5m10s Normal Info timestenclassic/repsample Pod repsample-1 RepAgent Not Running 5m10s Normal Info timestenclassic/repsample Pod repsample-1 RepScheme Exists 5m10s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState IDLE 5m4s Normal Info timestenclassic/repsample Pod repsample-1 Database Loaded 5m4s Normal Info timestenclassic/repsample Pod repsample-1 RepAgent Running 5m4s Normal Info timestenclassic/repsample Pod repsample-1 RepScheme Exists 5m4s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState STANDBY 5m4s Normal StateChange timestenclassic/repsample Pod repsample-1 is Ready 5m3s Normal Upgrade timestenclassic/repsample Upgrade of standby complete 5m3s Normal StateChange timestenclassic/repsample TimesTenClassic was StandbyDown, now Normal 4m32s Normal Upgrade timestenclassic/repsample Deleted active pod repsample-0 during upgrade 3m31s Warning Error timestenclassic/repsample Pod repsample-0 Unreachable for 117 seconds 3m31s Normal StateChange timestenclassic/repsample Pod repsample-0 is Not Ready 3m31s Normal StateChange timestenclassic/repsample Pod repsample-0 is Not Active Ready 3m31s Warning StateChange timestenclassic/repsample TimesTenClassic was Normal, now ActiveDown 3m30s Warning Failed timestenclassic/repsample Pod repsample-0 was replaced 3m29s Normal Info timestenclassic/repsample Pod repsample-1 Database Updatable 3m29s Normal StateChange timestenclassic/repsample Pod repsample-1 RepState ACTIVE 3m29s Normal StateChange timestenclassic/repsample Pod repsample-1 is Not Ready 3m29s Normal StateChange timestenclassic/repsample TimesTenClassic was ActiveDown, now ActiveTakeover 3m25s Normal StateChange timestenclassic/repsample Pod repsample-1 is Ready 3m25s Normal StateChange timestenclassic/repsample Pod repsample-1 is Active Ready 3m25s Normal StateChange timestenclassic/repsample TimesTenClassic was ActiveTakeover, now StandbyDown 2m35s Normal Info timestenclassic/repsample Pod repsample-0 Agent Up 2m35s Normal Info timestenclassic/repsample Pod repsample-0 Instance Exists 2m35s Normal Info timestenclassic/repsample Pod repsample-0 Daemon Down 2m35s Normal Info timestenclassic/repsample Pod repsample-0 Daemon Up 2m35s Normal Info timestenclassic/repsample Pod repsample-0 Database Unloaded 2m32s Normal Info timestenclassic/repsample Pod repsample-0 Database None 2m11s Normal Info timestenclassic/repsample Pod repsample-0 Database Loaded 2m11s Normal Info timestenclassic/repsample Pod repsample-0 RepAgent Not Running 2m11s Normal Info timestenclassic/repsample Pod repsample-0 RepScheme Exists 2m11s Normal StateChange timestenclassic/repsample Pod repsample-0 RepState IDLE 2m5s Normal Info timestenclassic/repsample Pod repsample-0 Database Loaded 2m5s Normal Info timestenclassic/repsample Pod repsample-0 RepAgent Running 2m5s Normal Info timestenclassic/repsample Pod repsample-0 RepScheme Exists 2m5s Normal StateChange timestenclassic/repsample Pod repsample-0 RepState STANDBY 2m5s Normal StateChange timestenclassic/repsample Pod repsample-0 is Ready 2m5s Normal Upgrade timestenclassic/repsample Upgrade of active complete 2m5s Normal Upgrade timestenclassic/repsample Upgrade completed in 359 secs 2m4s Normal StateChange timestenclassic/repsample TimesTenClassic was StandbyDown, now Normal
自動アップグレード・プロセスが完了します。TimesTenClassicオブジェクトは
Normal
状態です。TimesTenデータベースは稼働中であり、正しく機能しています。アクティブ・スタンバイ・ペア・レプリケーションは、それらの間に構成されます。 - アクティブ・データベースとスタンバイ・データベースで正しいリリースが実行されていることを確認します。
- アクティブなポッドにシェルを設定します。
kubectl exec -it repsample-1 -c tt -- /bin/bash
- TimesTen
ttVersion
ユーティリティを実行します。ttVersion
出力は、次のようになります。TimesTen Release 22.1.1.28.0 (64 bit Linux/x86_64) (instance1:6624) 2024-05-17T15:16:01Z Instance admin: timesten Instance home directory: /tt/home/timesten/instances/instance1 Group owner: timesten Daemon home directory: /tt/home/timesten/instances/instance1/info PL/SQL enabled.
- シェルを終了します。
- スタンバイ・ポッドにシェルを設定します。
kubectl exec -it repsample-0 -c tt -- /bin/bash
- TimesTen
ttVersion
ユーティリティを実行します。ttVersion
出力は、次のようになります。TimesTen Release 22.1.1.28.0 (64 bit Linux/x86_64) (instance1:6624) 2024-05-17T15:16:01Z Instance admin: timesten Instance home directory: /tt/home/timesten/instances/instance1 Group owner: timesten Daemon home directory: /tt/home/timesten/instances/instance1/info PL/SQL enabled.
- シェルを終了します。
アクティブ・データベースおよびスタンバイ・データベースで正しいリリースのTimesTenが実行されています。 - アクティブなポッドにシェルを設定します。
おめでとうございます。レプリケートされたTimesTenClassicオブジェクトの自動アップグレードが正常に完了しました。アクティブ・データベースとスタンバイ・データベースがアップグレードされ、稼働中であり、完全に動作しています。