コンテンツにスキップ

GreenPlum

Greenplum は、大規模並列処理(MPP)アーキテクチャに基づく高性能・高可用性のデータベースシステムで、主に大規模データセットの処理と分析に用いられます。Greenplum は、データウェアハウス、BI、ビッグデータ分析などのシナリオに適しており、特に PB 級のデータ量を扱う必要がある場合に、高効率なデータ保存と分析能力を提供できます。Greenplum の可観測性には、データベース性能の監視、障害の検知と通知、システム稼働状態の可視化が含まれます。

インストールと設定

前提条件

greenplum 5 または 6 バージョン、検証済みのバージョン:

  • 6.24.3

Exporter のインストール

ここから Greenplum Exporter をダウンロードしてインストールできます。これは greenplum のメトリクスを Prometheus に公開するデータ収集器で、GP5 と GP6 の両方をサポートします。

  • CentOS を例とした起動コマンドは以下のとおりです:
export GPDB_DATA_SOURCE_URL=postgres://gpadmin:password@10.17.20.11:5432/postgres?sslmode=disable
./greenplum_exporter --web.listen-address="0.0.0.0:9297" --web.telemetry-path="/metrics" --log.level=error
  • Docker で実行する場合の起動コマンドは以下のとおりです:
docker run -d -p 9297:9297 -e GPDB_DATA_SOURCE_URL=postgres://gpadmin:password@10.17.20.11:5432/postgres?sslmode=disable inrgihc/greenplum-exporter:latest 

注: 環境変数 GPDB_DATA_SOURCE_URL は Greenplum データベースへの接続文字列を指定します(postgres データベースには gpadmin アカウントで接続してください)。この接続文字列は postgres:// をプレフィックスとし、具体的な形式は以下のとおりです:

postgres://gpadmin:password@10.17.20.11:5432/postgres?sslmode=disable
postgres://[データベース接続アカウント、必ず gpadmin]:[アカウントのパスワード、つまり gpadmin のパスワード]@[データベースの IP アドレス]:[データベースのポート番号]/[データベース名、必ず postgres]?[パラメータ名]=[パラメータ値]&[パラメータ名]=[パラメータ値] 

その後、メトリクスの URL にアクセスします: http://127.0.0.1:9297/metrics

その他の起動パラメータ:

usage: greenplum_exporter [<flags>]

Flags:
  -h, --help                   Show context-sensitive help (also try --help-long and --help-man).
      --web.listen-address="0.0.0.0:9297"  
                               web endpoint
      --web.telemetry-path="/metrics"
                               Path under which to expose metrics.
      --disableDefaultMetrics  do not report default metric
      (go metrics and process metrics)
      --version                Show application version.
      --log.level="info"       Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
      --log.format="logger:stderr"  
                               Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"

収集器の設定

ホストにインストール

収集器の設定

greenplum exportermetrics URL を直接公開できるため、prom 収集器を使って対応する URL を設定し、そのまま収集できます。 DataKit のインストールディレクトリ内の conf.d/samples ディレクトリに入り、prom.conf.sample をコピーして greenplum.conf に名前を変更します

cp prom.conf.sample greenplum.conf

greenplum.conf の内容を次のように調整します:

[[inputs.prom]]
  ## Exporter URLs.
  urls = ["http://127.0.0.1:9297/metrics"]
  ## Collector alias.
  source = "greenplum"
...

その他の設定は必要に応じて調整してください、 調整パラメータの説明:

  • urls:prom メトリクスのアドレス。ここには greenplum が公開している対応するメトリクス URL を入力します。DataKit が greenplum ホストにインストールされている場合、既定値は http://127.0.0.1:9297/metrics です
  • source:データソース。greenplum に変更すると、後続でメトリクスを絞り込みやすくなります
  • interval:収集間隔

Datakit の再起動

Datakit の再起動

メトリクス

GreenPlum メトリクスセット

Metrics 説明 単位
cluster_state gp 到達状態?:1→ 利用可能;0→ 利用不可 boolean
cluster_uptime 起動からの経過時間 s
cluster_max_connections 最大接続数 int
cluster_total_connections 現在の接続数 int
cluster_idle_connections アイドル接続数 int
cluster_active_connections アクティブ接続数 int
cluster_running_connections クエリを実行中の接続数 int
cluster_waiting_connections クエリ実行待ちの接続数 int
node_segment_status segment の状態 int
node_segment_role segment の role 役割 int
node_segment_mode segment の mode int
node_segment_disk_free_mb_size segment ホストの空きディスク容量(MB) MB
cluster_total_connections_per_client 各クライアントの total 接続数 int
cluster_idle_connections_per_client 各クライアントの idle 接続数 int
cluster_active_connections_per_client 各クライアントの active 接続数 int
cluster_total_online_user_count オンラインアカウント数 int
cluster_total_client_count 現在すべての接続を持つクライアント数 int
cluster_total_connections_per_user 各アカウントの total 接続数 int
cluster_idle_connections_per_user 各アカウントの idle 接続数 int
cluster_active_connections_per_user 各アカウントの active 接続数 int
cluster_config_last_load_time_seconds システム設定の読み込み時間 s
node_database_name_mb_size 各データベースが占有するストレージ容量 MB
node_database_table_total_count 各データベース内のテーブル総数 int
exporter_total_scraped 正常に scrape したメトリクス数 int
exporter_total_error エラー総数 int
exporter_scrape_duration_second データ収集の継続時間 s
server_users_name_list ユーザー総数 int
server_users_total_count ユーザー詳細 int
server_locks_table_detail ロック情報 int
server_database_hit_cache_percent_rate キャッシュヒット率 float
server_database_transition_commit_percent_rate トランザクションコミット率 float
server_database_table_bloat_list データ膨張リスト int
server_locks_table_detail ロック情報 int

フィードバック

このページは役に立ちましたか?