IBM Support

db2cm コマンドを IWS 経由のスクリプト内から呼び出すと失敗する

Troubleshooting


Problem

Pacemaker で管理された Db2 クラスター環境で、db2cm -disable -all などの、db2cm コマンドを実行するようなスクリプトを IWS から実行すると以下のエラーで失敗します。
Error getting the host names of the cluster via crm_node -l
該当のスクリプトを root ユーザーでシェル上から実行すると問題なく実行ができます。IWS からの実行も同様に root から実行されているのになぜ db2cm コマンドの実行が失敗するのでしょうか。

Resolving The Problem

db2cm スクリプト内では様々な Pacemaker 関連のコマンドが呼ばれており、crm_node コマンドや crm コマンドを実行しています。これらのコマンドは /usr/sbin に存在しているため、PATH がこのディレクトリーを含んでいるかを確認してください。含んでいない場合はスクリプトの冒頭など、 db2cm コマンドの実行前に以下のように PATH に追加するようにしてください。
例)
PATH=$PATH:/usr/sbin

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m3p0000006xc1AAA","label":"High Availability-\u003EPacemaker"}],"ARM Case Number":"TS011024042","Platform":[{"code":"PF016","label":"Linux"}],"Version":"11.5.0;and future releases"}]

Document Information

Modified date:
26 October 2022

UID

ibm16832068