(O+P)ut

アウトプット



(O+P)ut

エンジニアのアウトプット

【Db2】db2_killを用いたインスタンス障害時のTSA/RSCTによる復旧確認

スポンサーリンク

確認したいこと

db2haicuで設定したTSAMP構成が組まれている環境で

$ lssam
Online IBM.ResourceGroup:db2_db2inst1_db2inst1_SAMPLE-rg Nominal=Online
        '- Online IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs
                |- Online IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs:test1
                '- Offline IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs:test2

PRIMARY側で以下コマンドを押下してインスタンストラブル時の動きを確認する。

$ db2_kill
環境情報
  • IBM Tivoli System Automation for Multiplatforms 4
  • DB2 v11.5
  • RHEL 7

確認結果

直後は以下のようにDBステータスがOnlineから外れるが

$ lssam
Pending online IBM.ResourceGroup:db2_db2inst1_db2inst1_SAMPLE-rg Nominal=Online
        '- Pending online IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs
                |- Pending online IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs:test1
                '- Offline IBM.Application:db2_db2inst1_db2inst1_SAMPLE-rs:test2

TSA/RSCTによってDBインスタンス起動/DBのアクティベートが自動的に実施され

... db2V115_start.ksh[40860]: 226: Entered /opt/rsct/sapolicies/db2/db2V115_start.ksh, db2inst1, 0
...
... db2V115_start.ksh[40860]: 180: su - db2inst1 -c db2 activate database SAMPLE

プライマリー/スタンバイの切り替わりなく正常に復旧する。

以下、補足です。

補足

RSCTが障害を検知し、TSAが自動的にアクションを実行する動きが確認できました。

具体的にはHADRのモニタースクリプトがオフラインを検知することで

... hadrV115_monitor.ksh[40419]: 348: Returning 1 : db2inst1 db2inst1 SAMPLE
... hadrV115_monitor.ksh[40701]: 41: Entering : db2inst1 db2inst1 SAMPLE
... hadrV115_monitor.ksh[40701]: 315: hadrV115_monitor.ksh[40701]  is offline, hadr monitor must return offline

データベースシステムの起動を自動的に行おうとします。

クライアントから見ると瞬断に伴うエラーはありますが、復旧後は正常にアクセスできます。

$ db2 "select * from sales"
SQL30108N  A connection failed in an automatic client reroute environment. The transaction was rolled back. Host name or IP address: "test2pritok05". Service name or port number: "51000". Reason code: "1". Connection failure code: "2".
Underlying error: "32".  SQLSTATE=08506

以上。