Sosreport ツール

Apigee Edge のドキュメントを表示しています。
Apigee X のドキュメントに移動します。
情報

Sosreport は、オープンソース ソフトウェア SoS に基づくシステムレベルの診断およびデータ収集ツールです。Sosreport ツールを使用すると、Apigee コンポーネントが実行されているノードの問題のデバッグに役立つ情報を収集できます。このツールは、ノードのファイル システムに情報をローカルで収集して保存します。

Sosreport ツールは、システムの構成の詳細、システム情報、診断情報を収集し、データをアーカイブに保存します。Apigee コンポーネントの場合、Sosreport は次の情報を収集します。

  • 実行中のカーネル バージョン
  • 読み込まれたモジュール
  • システムとサービスの構成ファイル

Sosreport は、外部プログラムを実行して、次のような追加情報を収集します。

  • すべてのコンポーネントからの Apigee ログ。
  • ランタイム診断
  • nodetool コマンドを使用して収集された Cassandra の診断。

Sosreport ツールには、次の 2 つの主要なコマンドがあります。

  • sosreport: データを収集してレポートを作成するための主要なコマンド。
  • apigee-sosreport: sosreport のインストールと、Apigee コンポーネントに固有の sosreport プラグインの管理に使用される補助ツール。

インストール

このセクションでは、sosreport をインストールする方法について説明します。

sosreport の SoS バージョンがすでにインストールされている場合

システムの元の SoS バージョンの sosreport がすでにインストールされている場合は、インストール パスが競合する可能性があるため、Apigee のバージョンを設定しないでください。代わりに、次のコマンドを使用して、Apigee 固有のプラグインを /opt/apigee/apigee-sosreport/source/plugin ディレクトリから適切な Python site-packages ディレクトリにコピーします。たとえば、agigee-mgmt.py をコピーするには:

  • Python 2 を使用している場合は、次のように入力します。
    sudo cp apigee-mgmt.py /usr/lib/python2.7/site-packages/sos/plugins/
  • Python 3 を使用している場合は、次のように入力します。
    sudo cp apigee-mgmt.py /usr/local/lib/python3.6/site-packages/sos/plugins/

プラグインがインストールされていることを確認するには、

sudo sosreport --list-plugins

ご不明な点がございましたら、Apigee サポートにお問い合わせください。

Apigee バージョンの sosreport をインストールする

sosreport の SoS バージョンがシステムにまだインストールされていない場合は、Edge for Private Cloud がインストールされているすべてのノードで次のコマンドを入力して、Apigee のバージョンをインストールできます。

/opt/apigee/apigee-service/bin/apigee-service apigee-sosreport install
/opt/apigee/apigee-service/bin/apigee-service apigee-sosreport setup

sosreport がインストールされていることをテストするには、Apigee 関連のプラグインが次のディレクトリにあることを確認します。

/usr/lib/pythonx.x/site-packages/sos/plugins

ここで、pythonx.x はインストールされている Python のバージョンです。

または、次のいずれかのコマンドを実行します。

  • Apigee 固有のプラグインのみを検証するには:
    apigee-service apigee-sosreport diagnose -l

    これにより、Apigee 固有のプラグインのリストが返されます。

    sosreport (version 3.9)
    
    The following plugins are currently enabled:
    
    apigee-mgmt          This is the apigee plugin for edge-management-server
    apigee-mp            This is the apigee plugin for edge-message-processor
    apigee-rrt           This is the apigee plugin for edge-router
    apigee-sample        Main diagnostics gatehring class
  • すべてのプラグインを検証するには:
    apigee-service apigee-sosreport diagnose -s -l

    sosreport で使用可能なプラグインのリストが返されます。

    sosreport (version 3.9)
    
    The following plugins are currently enabled:
    
     acpid                ACPI daemon information
     alternatives         System alternatives
     anacron              Anacron job scheduling service
     apigee-cassandra     This is the base class for sosreport plugins. Plugins should subclass
        this and set the class variables where applicable. ←truncated→
     apigee-mgmt          This is the base class for sosreport plugins. Plugins should subclass
        this and set the class variables where applicable. ←truncated→
     apigee-mp            Main diagnostics gathering class
     apigee-rrt           This is the base class for sosreport plugins. Plugins should subclass
        this and set the class variables where applicable. ←truncated→
    
    ………………………………………………….
    ………………………………………………….
    ………………………………………………….
    ←truncated→

レポートの作成

Sosreport ツールを使用してレポートを作成するには、必要なプラグイン オプションを指定して sosreport コマンドを実行します(Apigee プラグインをご覧ください)。レポートが保存されるデフォルトのディレクトリは、tmp または /var/tmp です。別のディレクトリを tmp-dir オプションに渡すことで、レポートが保存されているディレクトリを変更できます。たとえば、管理サーバーのレポートを作成して my_report-dir という名前のディレクトリに保存するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf -o apigee-mgmt  --batch --tmp-dir=my_report-dir
  • SoS バージョンの sosreport を使用する場合:
    sudo sosreport -o apigee-mgmt  --batch --tmp-dir=my_report-dir

レポートは、tmp-dir オプションを使用して指定したディレクトリの .tar.xz ファイルに保存されます。.tar.xz ファイルの場所とチェックサムが STDOUT に表示されます。次に例を示します。

Your sosreport has been generated and saved in:
 /var/sosreport-prc-test-0-9613-2021-07-12-orwxufx.tar.xz
The checksum is: 5a8b97c6020346a688254c8b04ef86ec
For more available options for sosreport, read the man file:
sudo man sosreport

レポートは、tmp-dir オプションを使用して指定したディレクトリの .tar.xz ファイルに保存されます。.tar.xz file の場所とチェックサムが STDOUT に表示されます。次に例を示します。

sosreport で使用できるその他のオプションについては、man ファイルをご覧ください。

sudo man sosreport

Apigee プラグイン

以降のセクションでは、次のコンポーネントの Sosreport ツール用の Apigee プラグインについて説明します。

管理サーバー

apigee-mgmt プラグインは、管理サーバーから次の情報を収集します。

  • サーバーのホスト名(デフォルト)
  • cpuinfo(デフォルト)
  • meminfo(デフォルト)
  • メモリ、Djdk.tls.allowUnsafeServerCertChange などの Java 仮想マシン(JVM)の設定(デフォルト)
  • 現在の管理ログ(デフォルト)
  • 10 個の連続した top と jstacks 出力(デフォルト)
  • 管理ログ フォルダ全体(省略可)
  • config-files(省略可)

例:

すべてのデフォルト アイテムを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mgmt --batch my_report-dir
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mgmt --batch my_report-dir

すべてのデフォルト アイテムと、コマンドで指定されたオプション アイテム(構成ファイルやすべてのログなど)を収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mgmt --batch -k apigee-mgmt.config-files -k apigee-mgmt.all-logs
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mgmt --batch -k apigee-mgmt.config-files -k apigee-mgmt.all-logs

すべてを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mgmt --batch -k apigee-mgmt.config-files -k apigee-mgmt.all-logs

    または、次のように入力することもできます。

    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mgmt --batch -a
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mgmt --batch -k apigee-mgmt.config-files -k apigee-mgmt.all-logs

    または、次のように入力することもできます。

    sudo sosreport -o apigee-mgmt --batch -a

Message Processor

apigee-mp プラグインは、管理プロセッサ(MP)から次の情報を収集します。

  • サーバーのホスト名(デフォルト)
  • cpuinfo(デフォルト)
  • meminfo(デフォルト)
  • buildinfo/リリース情報(デフォルト)
  • apigee-all のステータス(デフォルト)
  • サーバーの詳細(デフォルト)
  • JVM レベルの設定(メモリ、Djdk.tls.allowUnsafeServerCertChange など)(デフォルト)
  • 現在の MP ログ(デフォルト)
  • 10 個の連続した top、jstack、NIO 指標の出力(デフォルト)
  • MP ログフォルダ全体(省略可)
  • 分類ツリー(省略可)
  • ヒープダンプ(省略可)
  • config-files(省略可)
  • ランタイム トレース(省略可。org:env:api:rev detail が指定されている場合のみ)。注: プラグインは、ランタイム リクエストを収集するために 25 秒間待機します。

例:

すべてのデフォルト アイテムを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mp --batch
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mp --batch

すべてのデフォルト項目に加えて、収集する追加のオプション項目を指定することもできます。たとえば、-k apigee-mp.heap フラグを使用してヒープダンプを指定するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mp --batch -k apigee-mp.heap
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mp --batch -k apigee-mp.heap

同様に、次のオプション項目を指定できます。

-k apigee-mp.deployments
-k apigee-mp.heap
-k apigee-mp.all-logs
-k apigee-mp.config-files
-k apigee-mp.trace=gsc-cps:test:httpbin:3

1 つのコマンドで複数のオプションを指定できます。次に例を示します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mp --batch -k apigee-mp.deployments -k apigee-mp.all-logs
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mp --batch -k apigee-mp.deployments -k apigee-mp.all-logs

トレース以外のすべてを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-mp --batch -a
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-mp --batch -a

ルーター

apigee-rrt プラグインは、ルーターから次の情報を収集します。

  • サーバーのホスト名(デフォルト)
  • cpuinfo(デフォルト)
  • meminfo(デフォルト)
  • buildinfo/リリース情報(デフォルト)
  • apigee-all のステータス(デフォルト)
  • サーバーの詳細(デフォルト)
  • ps 出力。これにより、メモリ、Djdk.tls.allowUnsafeServerCertChange などの JVM レベルの設定が取得されます(デフォルト)。
  • 現在のルーターログ(デフォルト)
  • 無効なファイル名を含む vhost ファイル名のリスト(デフォルト)
  • Router ログフォルダ全体(省略可)
  • config-files(省略可)

例:

すべてのデフォルト アイテムを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-rrt --batch
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-rrt --batch

すべてのデフォルト項目に加えて、収集する追加のオプション項目を指定することもできます。たとえば、-k apigee-rrt.all-logs フラグを使用してログフォルダ全体を指定するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-rrt --batch -k apigee-rrt.all-logs
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-rrt --batch -k apigee-rrt.all-logs

同様に、次のオプション項目を指定できます。

-k apigee-rrt.all-logs
-k apigee-rrt.config-files

すべてを収集するには:

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-rrt --batch -a
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-rrt --batch -a

Cassandra

apigee-cassandra プラグインは、Cassandra ノードから次の情報を収集します。

  • マシンの統計情報:
    "hostname -i"
    "cat /proc/cpuinfo"
    "cat /proc/meminfo"
    "ulimit -a"
    "ps auxw"
    "df -kh"
    "du -sh"
    "netstat -ntlpu"
    "free -h"
    "ifconfig -h"
    "ps -ef"
  • Apigee コンポーネントのステータスとバージョン apigee-all version && apigee-all status
  • apigee-cassandra ログ: /opt/apigee/var/log/apigee-cassandra/ のすべてのファイル
  • commit ログの数
  • Top コマンドの出力
  • スレッドダンプ
  • 構成ファイル: cassandra-topology.propertiescassandra.yamlcassandra-env.sh
  • 次のパラメータの Nodetool 出力: version、status、ring、info、gossipinfo、compactionstats -H、tpstats、netstats、cfstats、proxyhistograms

例:

すべてのデフォルト アイテムを収集するには、次のいずれかを入力します。

  • Apigee バージョンの sosreport を使用する場合:
    sudo sosreport --config-file /opt/apigee/apigee-sosreport/conf/sos.conf  -o apigee-cassandra
  • SoS バージョンの sosreport を使用する:
    sudo sosreport -o apigee-cassandra