Hub Reporting

The Hub prepares and provides content for multiple peripheral SUSE Manager Servers. The goal of the reporting feature is to get data from these Servers back and have combined reporting data available on the Hub. The data is made available for external Reporting Tools.

1. Architecture

The main database is a PostgresDB in the SUSE Manager Hub system. It stores all the information collected from all the servers, and aggregates them. Every peripheral Server has its own reporting database where the information is collected for that system. In summary:

  • the DB in SUSE Manager Hub stores, collects and eventually aggregates data coming from all the DBs of the peripheral Servers,

  • the DB in SUSE Manager Hub stores also its own data from the systems directly connected and managed by the Hub,

  • the DB in peripheral SUSE Manager Server stores its own data,

  • the reporting tool can be connected either to the Hub or to any SUSE Manager Server.

2. Setup

The reporting database and schema are set up by default using the local PostgreSQL server. The reporting database is a separate database accessible via the network.

As a requirement we expect all server certificates are signed by the same Root Certificate Authority (CA). The whole SUSE Manager Hub environment should be using only one Root CA.

2.1. Create a DB user for the reporting

Before connecting an external Reporting Tools to the Database, a user with read-only permission should be created. For doing that, it is possible to use uyuni-setup-reportdb-user.

usage: uyuni-setup-reportdb-user [options]

options:
  --help
            show this help message and exit
  --non-interactive
            Switches to non-interactive mode
  --dbuser=DBUSER
            Report DB User
  --dbpassword=DBPASSWORD
            Report DB Password
  --add
            Add the new user
  --delete
            Delete the user
  --modify
            Set a new password

3. データベーススキーマ

スキーマにより、SUSE Managerデータベースから最も重要なテーブルを、レポートに関連するデータのみが含まれる非正規化された亜種としてエクスポートします。

すぐに使用できるレポートは、複数のテーブルにわたってデータを集約するビューとして提供されます。

すべてのテーブルは、データを提供したSUSE Managerサーバを指定する追加のID列(mgm_id)を取得します。単一のSUSE Managerサーバでは、この列には、localhostを表す標準の値`1`が設定されています。SUSE Manager Hubでは、この値は、管理対象サーバがHubデータベース内で持っている実際のサーバIDに置き換えられます。

もう1つの共通の追加フィールドは`synced_date`です。これは、データがSUSE Managerサーバのメインデータベースからサポートされた日時を表します。

スキーマドキュメントは、左側のナビゲーションバー → ヘルプ  Report Database Schema (レポートのデータベーススキーマ)で参照できます。

4. データの生成と更新

SUSE Managerは、taskomaticジョブを使用して、Reportingデータベースのデータを生成し、周辺サーバからHubにデータを取得します。

周辺サーバ上のデータを生成および更新するための処理を行うスケジュールは、`update-reporting-default`と呼ばれます。これはデフォルトで毎日午前0時に実行されます。

SUSE Manager Hubには、2つ目の重要なスケジュールがあります。登録されているすべての周辺サーバからレポーティングデータを取得するために、 `update-reporting-hub-default`という名前のタスクが毎日午前1:30に実行されます。

時刻はすべてサーバのローカルタイムゾーンです。周辺サーバが異なるタイムゾーンにある場合は、すべてのスケジュールを調整することをお勧めします。すべてのレポーティングデータが特定の時点で収集され、すべての周辺サーバがそのローカルジョブを実際に完了した時点で`update-reporting-hub-default`が実行されるようにしてください。

4.2. report_db_batch_size

説明

あるデータベースから1回にフェッチして他のデータベースに書き込む行の最大数。

調整すべき状況

メモリ不足エラーまたは処理速度の問題が発生する場合。

デフォルト値

2000

推奨値

500~5000

場所

/etc/rhn/rhn.conf

report_db_batch_size = 4000

変更後

メモリ使用状況を確認します。 変更の前後にメモリ使用状況を細かく監視します。

4.3. report_db_hub_workers

説明

同一時点でハブ上の周辺サーバにデータを要求するワーカの最大数。

調整すべき状況

周辺サーバの数が大幅に増えた(100を超えた)場合、または同期を高速化する必要がある場合。

デフォルト値

2

推奨値

2~10

場所

/etc/rhn/rhn.conf

report_db_hub_workers = 5

変更後

メモリ使用状況を確認します。 変更の前後にハブのメモリおよびCPUの使用状況を細かく監視します。 さらに、ハブのレポーティングデータベースの負荷、およびCPUとメモリの使用状況も監視します。

周辺サーバから収集されたすべてのデータはハブのレポーティングデータベースに書き込まれる必要があります。 そのデータベースを調整しても、パフォーマンスが向上する可能性があります。