reexamine値の設定

この例では、レプリケートされたTimesTenClassicオブジェクトのreexamine値の設定方法を示します。この例は、reexamine値が変更された後にTimesTenオペレータが実行する処理も示しています。

  1. reexamine値を設定します。値は、TimesTenClassicオブジェクトの現在の値と異なる必要があります。TimesTenオペレータは、この値を調査し、最後の反復以降に変更されたことを認識すると、適切な処理を実行します。

    kubectl editコマンドを使用して、TimesTenClassicオブジェクトを編集します。

    • ファイル内にreexamineの行がある場合は、その値を変更します。現在の値と異なる必要があります。

    • ファイル内にreexamineの行がない場合は、行を追加して値を指定します。

    この例では、reexamine行はありません。この例では、reexamine行を追加し、reexamineの値をApril22reexamine1に設定します(boldで表示)。

    ノート: 出力のすべては示していません。

    % kubectl edit timestenclassic sample
    # 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/v3
    kind: TimesTenClassic
    metadata:
    ...
      name: sample
      namespace: mynamespace
    ...
    repCreateStatement: |
      create active standby pair
        "{{tt-name}}" on "{{tt-node-0}}",
        "{{tt-name}}" on "{{tt-node-1}}"
      RETURN TWOSAFE
      store "{{tt-name}}" on "{{tt-node-0}}"
        PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
      store "{{tt-name}}" on "{{tt-node-1}}"
        PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
    spec:
      ttspec:
        bothDownBehavior: Best
        dbConfigMap:
        - sample
        image: container-registry.oracle.com/timesten/timesten:22.1.1.30.0
        imagePullSecret: sekret
        storageClassName: oci-bv
        storageSize: 250Gi
        reexamine: April22reexamine1
    ...
    timestenclassic.timesten.oracle.com/sample edited
    
  2. kubectl getコマンドを使用して、sample TimesTenClassicオブジェクトの状態を評価します。複数のkubectl getコマンドを発行して、状態がどのように変化するかを確認します。また、オペレータはsample-1をアクティブとして正常に構成しました。
    % kubectl get ttc sample 
    NAME     STATE       ACTIVE   AGE 
    sample   Reexamine   None     68m 
    % kubectl get ttc sample 
    NAME     STATE               ACTIVE   AGE 
    sample   ConfiguringActive   None     68m 
    % kubectl get ttc sample 
    NAME     STATE         ACTIVE     AGE 
    sample   StandbyDown   sample-1   68m 
    % kubectl get ttc sample 
    NAME     STATE    ACTIVE     AGE
    sample   Normal   sample-1   71m
    
  3. kubectl describeコマンドを使用して、オペレータの処理をさらにレビューします(boldで表示)。

    出力のすべては示していません。

    % kubectl describe ttc sample
    Name:         sample
    Namespace:    mynamespace
    ...
    Kind:         TimesTenClassic
    ...
    Rep Create Statement:  create active standby pair
      "{{tt-name}}" on "{{tt-node-0}}",
      "{{tt-name}}" on "{{tt-node-1}}"
    RETURN TWOSAFE
    store "{{tt-name}}" on "{{tt-node-0}}"
      PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
    store "{{tt-name}}" on "{{tt-node-1}}"
      PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
     
    Spec:
      Ttspec:
        Both Down Behavior:  Best
        Db Config Map:
          sample
        Image:               container-registry.oracle.com/timesten/timesten:22.1.1.30.0
        Image Pull Policy:   Always
        Image Pull Secret:   sekret
        Reexamine:           April22reexamine1
        Stop Managing:       April21Stop1
        Storage Class Name:  oci-bv
        Storage Size:        250Gi
    Status:
      Classic Upgrade Status:
        Active Start Time:           0
        Active Status:
        Image Update Pending:        false
        Last Upgrade State Switch:   0
        Prev Reset Upgrade State:
        Prev Upgrade State:
        Standby Start Time:          0
        Standby Status:
        Upgrade Start Time:          0
        Upgrade State:
      Active Pods:                   sample-1
      High Level State:              Normal
      Last Event:                    54
      Last High Level State Switch:  1619230912
      Pod Status:
        Cache Status:
          Cache Agent:        Not Running
          Cache UID Pwd Set:  true
          N Cache Groups:     0
        Db Status:
          Db:                          Loaded
          Db Id:                       475
          Db Updatable:                No
        Initialized:                   true
        Last High Level State Switch:  ?
        Pod Status:
          Agent:                Up
          Last Time Reachable:  1619231126
          Pod IP:               10.244.7.89
          Pod Phase:            Running
        Prev High Level State:  Healthy
        Prev Image:
        Replication Status:
          Last Time Rep State Changed:  0
          Rep Agent:                    Running
          Rep Peer P State:             start
          Rep Scheme:                   Exists
          Rep State:                    STANDBY
        Times Ten Status:
          Daemon:          Up
          Instance:        Exists
          Release:         22.1.1.30.0
        Admin User File:   false
        Cache User File:   false
        Cg File:           false
        Disable Return:    false
        High Level State:  Healthy
        Intended State:    Standby
        Local Commit:      false
        Name:              sample-0
        Schema File:       false
        Using Twosafe:     false
        Cache Status:
          Cache Agent:        Not Running
          Cache UID Pwd Set:  true
          N Cache Groups:     0
        Db Status:
          Db:                          Loaded
          Db Id:                       476
          Db Updatable:                Yes
        Initialized:                   true
        Last High Level State Switch:  ?
        Pod Status:
          Agent:                Up
          Last Time Reachable:  1619231126
          Pod IP:               10.244.6.149
          Pod Phase:            Running
        Prev High Level State:  Healthy
        Prev Image:
        Replication Status:
          Last Time Rep State Changed:  1619228670
          Rep Agent:                    Running
          Rep Peer P State:             start
          Rep Scheme:                   Exists
          Rep State:                    ACTIVE
        Times Ten Status:
          Daemon:             Up
          Instance:           Exists
          Release:            22.1.1.30.0
        Admin User File:      false
        Cache User File:      false
        Cg File:              false
        Disable Return:       false
        High Level State:     Healthy
        Intended State:       Active
        Local Commit:         false
        Name:                 sample-1
        Schema File:          false
        Using Twosafe:        false
      Prev High Level State:  StandbyDown
      Prev Reexamine:         April22reexamine1
      Prev Stop Managing:     April21Stop1
      Rep Create Statement:   create active standby pair "sample" on 
    "sample-0.sample.mynamespace.svc.cluster.local", "sample" on 
    "sample-1.sample.mynamespace.svc.cluster.local" NO RETURN store "sample" on 
    "sample-0.sample.mynamespace.svc.cluster.local" PORT 4444 FAILTHRESHOLD 0 store 
    "sample" on "sample-1.sample.mynamespace.svc.cluster.local" PORT 4444 FAILTHRESHOLD 0
      Rep Port:               4444
      Status Version:         1.0
    Events:
      Type  Reason       Age    From       Message
      ----  ------       ----   ----       -------
      -     StateChange  58m    ttclassic  TimesTenClassic was Normal, now ManualInterventionRequired
      -     StateChange  46m    ttclassic  Pod sample-0 Daemon Down
      -     StateChange  41m    ttclassic  Pod sample-1 Daemon Down
      -     StateChange  41m    ttclassic  Pod sample-1 Daemon Up
      -     StateChange  41m    ttclassic  Pod sample-1 Database Unloaded
      -     StateChange  40m    ttclassic  Pod sample-1 Database Loaded
      -     StateChange  40m    ttclassic  Pod sample-1 RepState IDLE
      -     StateChange  40m    ttclassic  Pod sample-1 RepAgent Not Running
      -     StateChange  17m    ttclassic  Pod sample-1 Database Updatable
      -     StateChange  17m    ttclassic  Pod sample-1 RepScheme None
      -     StateChange  4m21s  ttclassic  TimesTenClassic was ManualInterventionRequired, now Reexamine
      -     Error        4m16s  ttclassic  Active error: Daemon Down
      -     StateChange  4m16s  ttclassic  TimesTenClassic was Reexamine, now ConfiguringActive
      -     StateChange  4m10s  ttclassic  Pod sample-1 RepState ACTIVE
      -     StateChange  4m10s  ttclassic  Pod sample-1 RepScheme Exists
      -     StateChange  4m10s  ttclassic  Pod sample-1 RepAgent Running
      -     StateChange  4m8s   ttclassic  TimesTenClassic was ConfiguringActive, now StandbyDown
      -     StateChange  4m3s   ttclassic  Pod sample-0 Daemon Up
      -     StateChange  4m3s   ttclassic  Pod sample-0 Database Unloaded
      -     StateChange  3m56s  ttclassic  Pod sample-0 Database None
      -     StateChange  3m42s  ttclassic  Pod sample-0 Database Loaded
      -     StateChange  3m42s  ttclassic  Pod sample-0 Database Not Updatable
      -     StateChange  3m42s  ttclassic  Pod sample-0 RepAgent Not Running
      -     StateChange  3m42s  ttclassic  Pod sample-0 RepState IDLE
      -     StateChange  3m36s  ttclassic  Pod sample-0 RepAgent Running
      -     StateChange  3m36s  ttclassic  Pod sample-0 RepState STANDBY
      -     StateChange  3m36s  ttclassic  TimesTenClassic was StandbyDown, now Normal
    
  4. kubectl exec -itコマンドを使用して、TimesTenデータベースを含むsample-1ポッド内のシェルを起動します。次に、アクティブ・データベースに接続できることを確認します。
    % kubectl exec -it sample-1 -c tt -- /bin/bash
    $ ttIsql sample
     
    Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
     
     
     
    connect "DSN=sample";
    Connection successful: DSN=sample;UID=timesten;DataStore=/tt/home/timesten/datastore/sample;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;AutoCreate=0;PermSize=200;DDLReplicationLevel=3;ForceDisconnectEnabled=1;
    (Default setting AutoCommit=1)
    Command> call ttRepStateGet;
    < ACTIVE >
    1 row found.
    
  5. kubectl exec -itコマンドを使用して、TimesTenデータベースを含むsample-0ポッド内のシェルを起動します。次に、スタンバイ・データベースに接続できることを確認します。
    % kubectl exec -it sample-0 -c tt -- /bin/bash
    % ttIsql sample
     
    Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
     
     
     
    connect "DSN=sample";
    Connection successful: DSN=sample;UID=timesten;DataStore=/tt/home/timesten/datastore/sample;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;AutoCreate=0;
    PermSize=200;DDLReplicationLevel=3;ForceDisconnectEnabled=1;
    (Default setting AutoCommit=1)
    Command> call ttRepStateGet;
    < STANDBY >
    1 row found.
    

TimesTenオペレータがTimesTenClassicオブジェクトを管理および監視するようになりました。TimesTenClassicオブジェクトはNormal状態です。いずれのデータベースも稼働中で、すぐに使用できます。