Sosreport ツール

ここに表示されているのは Apigee Edge のドキュメントです。
Go to the Apigee X のドキュメントに移動します
info

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

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

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

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

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

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

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

インストール

次の表に、Edge for Private Cloud でサポートされているバージョンでの Sosreport ツールの可用性とインストール方法を示します。

OPDK バージョン 新規インストール インプレース アップグレード
4.50.00.11 - 4.52.01.00 手動インストールが必要 手動インストールが必要
4.52.01.01+ デフォルトでインストール済み デフォルトでインストール済み
Amazon Linux 2023 以降 サポート対象外 サポート対象外

Edge for Private Cloud バージョン 4.52.01.01 以降をセットアップまたは更新すると、Sosreport ツールはすべてのノードにデフォルトでインストールされます。

次のコマンドを実行して、Sosreport ツールとそのプラグインのインストールとバージョンを確認できます。

apigee-service apigee-sosreport version

Sosreport ツールをサポートするすべてのプラグインを一覧表示するには、次のコマンドを使用します。

sudo sosreport --list-plugins

Apigee 固有のプラグインのみを一覧表示するには、次のコマンドを実行します。

sudo sosreport --list-plugins | grep apigee

Edge for Private Cloud バージョン 4.50.00.11 ~ 4.52.01.00 では、Sosreport ツールを使用できますが、環境によっては手動設定が必要になる場合があります。

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

元の SoS バージョンの sosreport がすでにシステムにインストールされている場合は、インストール パスが競合する可能性があるため、Apigee バージョンをセットアップしないでください。 代わりに、次のコマンドを使用して、Apigee 固有のプラグインをディレクトリ /opt/apigee/apigee-sosreport/source/plugin から適切な Python site-packages ディレクトリにコピーします。 たとえば、apigee-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 サポートにお問い合わせください。

次のセクションでは、バージョン 4.50.00.11 ~ 4.52.01.00 の `sosreport` をインストールする方法について説明します。

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

SoS バージョンの sosreport がシステムにまだインストールされていない場合は、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 gathering 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→

レポートの作成

Edge for Private Cloud バージョン 4.52.01.01 以降

Sosreport ツールは、ノード上の既存のコンポーネントを検出し、サポートチームが分析に必要なすべてのログのレポートを生成できます。

レポートを生成するには、次のコマンドを使用します。

apigee-service apigee-sosreport diagnose

必要に応じて、次のフラグを追加できます。

  • -f | --file | --config : セットアップの実行時に使用する構成ファイルのパス。
    Example: apigee-service apigee-sosreport diagnose -f /path/to/configuration.file
  • -o | --output : 生成された sosreport を特定のディレクトリまたはパスにリダイレクトする場合
    Example: apigee-service apigee-sosreport diagnose -o /path/to/output_directory/

Edge for Private Cloud バージョン 4.50.00.11 ~ 4.52.01.00

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 プラグインは、Management Processor(MP)から次の情報を収集します。

  • サーバーのホスト名(デフォルト)
  • cpuinfo(デフォルト)
  • meminfo(デフォルト)
  • buildinfo/リリース情報(デフォルト)
  • apigee-all のステータス(デフォルト)
  • サーバーの詳細(デフォルト)
  • JVM レベルの設定(メモリ、Djdk.tls.allowUnsafeServerCertChange、 など)(デフォルト)
  • 現在の MP ログ(デフォルト)
  • 上位 10 件の連続する top、jstacks、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 の出力。これにより、JVM レベルの設定(例: メモリ、Djdk.tls.allowUnsafeServerCertChange など)が取得されます(デフォルト)。
  • 現在のルーターログ(デフォルト)
  • 無効なファイル名を含む vhost ファイル名のリスト(デフォルト)
  • ルーターログフォルダ全体(省略可)
  • 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