コンテンツにスキップ

Aerospike


·


Aerospike Namespace のパフォーマンスメトリクスを表示します。クラスタ、Namespace 配下のメモリ使用量、ディスク使用量、オブジェクト数、読み書きレートなどを含みます。

Aerospike Node 関連のメトリクスを表示します。Node クラスタ、Node 状態、レコード数、メモリ、ディスクのメトリクスなどを含みます。

インストールと設定

前提条件

  • Aerospike がインストールされていること

サンプルの Aerospike バージョンは Linux 環境の 6.0.0 (CentOS) です。各バージョンによってメトリクスに差異がある場合があります。

aerospike-prometheus-exporter は Aerospike 公式の Exporter で、Aerospike を監視へすばやく接続できます。

メトリクス収集

exporter のインストール

exporter の公式ダウンロード&インストール先 https://docs.aerospike.com/monitorstack/install/linux

wget https://www.aerospike.com/download/monitoring/aerospike-prometheus-exporter/latest/artifact/rpm -O aerospike-prometheus-exporter.tgz
tar -xvzf aerospike-prometheus-exporter.tgz
rpm -Uvh aerospike-prometheus-exporter--x86_64.rpm

exporter の設定

設定ファイルは /etc/aerospike-prometheus-exporter/ape.toml です。デフォルトの metrics ポートは 9145、デフォルトの収集ポートは 3000 で、通常は設定ファイルの調整は不要です。

[Agent]
# Exporter の HTTPS (TLS) 設定
# Prometheus と Exporter 間の HTTPS

# TLS 証明書。
# 以下の形式をサポートします。
# 1. 証明書ファイルのパス                                      - "file:<file-path>"
# 2. Base64 エンコードされた証明書を含む環境変数             - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
# 3. Base64 エンコードされた証明書                            - "b64:<base64-encoded-certificate>"
# 'root_ca'、'cert_file'、'key_file' の設定に適用されます。

# サーバー証明書
cert_file = ""

# サーバー証明書に対応する秘密鍵
key_file = ""

# クライアント証明書を検証するための Root CA (mutual TLS 用)
root_ca = ""

# 暗号化された key_file のパスフレーズ。以下の形式をサポートします。
# 1. 直接指定のパスフレーズ                                       - "<passphrase>"
# 2. ファイル経由のパスフレーズ                                 - "file:<file-that-contains-passphrase>"
# 3. 環境変数経由のパスフレーズ                                 - "env:<environment-variable-that-holds-passphrase>"
# 4. Base64 エンコードされたパスフレーズを含む環境変数経由      - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Base64 エンコード形式のパスフレーズ                        - "b64:<base64-encoded-passphrase>"
key_file_passphrase = ""

# たとえば labels={zone="asia-south1-a", platform="google compute engine"} のように prometheus metrics に追加するラベル
labels = {}

bind = ":9145"

# metrics サーバーのタイムアウト(秒)
timeout = 10

# Exporter のログ設定
# ログファイルのパス(任意、デフォルトではコンソールに出力)
# レベルは info|warning,warn|error,err|debug|trace(デフォルトは 'info')
log_file = ""
log_level = ""

# '/metrics' の基本認証。
# 以下の形式をサポートします。
# 1. 直接指定の認証情報                                        - "<credential>"
# 2. ファイル経由の認証情報                                  - "file:<file-that-contains-credential>"
# 3. 環境変数経由の認証情報                                  - "env:<environment-variable-that-contains-credential>"
# 4. Base64 エンコードされた認証情報を含む環境変数経由         - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Base64 エンコード形式の認証情報                          - "b64:<base64-encoded-credential>"
basic_auth_username = ""
basic_auth_password = ""

[Aerospike]
db_host = "localhost"
db_port = 3000

# TLS 証明書。
# 以下の形式をサポートします。
# 1. 証明書ファイルのパス                                      - "file:<file-path>"
# 2. Base64 エンコードされた証明書を含む環境変数             - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
# 3. Base64 エンコードされた証明書                            - "b64:<base64-encoded-certificate>"
# 'root_ca'、'cert_file'、'key_file' の設定に適用されます。

# ルート証明書ファイル
root_ca = ""

# 証明書ファイル
cert_file = ""

# 鍵ファイル
key_file = ""

# 暗号化された key_file のパスフレーズ。以下の形式をサポートします。
# 1. 直接指定のパスフレーズ                                       - "<passphrase>"
# 2. ファイル経由のパスフレーズ                                 - "file:<file-that-contains-passphrase>"
# 3. 環境変数経由のパスフレーズ                                 - "env:<environment-variable-that-holds-passphrase>"
# 4. Base64 エンコードされたパスフレーズを含む環境変数経由      - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Base64 エンコード形式のパスフレーズ                        - "b64:<base64-encoded-passphrase>"
key_file_passphrase = ""

# 認証用の node TLS 名
node_tls_name = ""

# Aerospike クラスタのセキュリティ認証情報。
# 以下の形式をサポートします。
# 1. 直接指定の認証情報                                        - "<credential>"
# 2. ファイル経由の認証情報                                  - "file:<file-that-contains-credential>"
# 3. 環境変数経由の認証情報                                  - "env:<environment-variable-that-contains-credential>"
# 4. Base64 エンコードされた認証情報を含む環境変数経由         - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Base64 エンコード形式の認証情報                          - "b64:<base64-encoded-credential>"
# 'user' と 'password' の設定に適用されます。

# データベースユーザー
user = ""

# データベースパスワード
password = ""

# 認証モード: internal(server 用)、external(LDAP など)
auth_mode = ""

# サーバーノードへコマンド送信する際のタイムアウト(秒)
timeout = 5

# latency メトリクスとしてエクスポートするヒストグラムのバケット数。バケットのしきい値は 2^0 から 2^16(17 バケット)です。
# 例: latency_buckets_count=5 は最初の 5 バケット、つまり <=1ms、<=2ms、<=4ms、<=8ms、<=16ms を出力します。
# デフォルト: 0(すべてのしきい値バケットを出力)。
latency_buckets_count = 0

# Metrics Allowlist - 指定した場合、これらのメトリクスのみを収集します。空リストはすべてのメトリクスを除外します。
# 下の allowlist 設定のコメントアウトを外すと、メトリクスフィルタリングは無効になります(つまり、すべてのメトリクスが収集されます)。

# Namespace metrics allowlist
# namespace_metrics_allowlist = []

# Set metrics allowlist
# set_metrics_allowlist = []

# Node metrics allowlist
# node_metrics_allowlist = []

# XDR metrics allowlist (Aerospike 5.0 以上のみ)
# xdr_metrics_allowlist = []

# Job (scans/queries) metrics allowlist
# job_metrics_allowlist = []

# Secondary index metrics allowlist
# sindex_metrics_allowlist = []

# Metrics Blocklist - 指定した場合、これらのメトリクスは収集されません。

# Namespace metrics blocklist
# namespace_metrics_blocklist = []

# Set metrics blocklist
# set_metrics_blocklist = []

# Node metrics blocklist
# node_metrics_blocklist = []

# XDR metrics blocklist (Aerospike 5.0 以上のみ)
# xdr_metrics_blocklist = []

# Job (scans/queries) metrics blocklist
# job_metrics_blocklist = []

# Secondary index metrics blocklist
# sindex_metrics_blocklist = []

# Users Statistics (user statistics は Aerospike 5.6+ で利用可能)
# どのユーザーの統計を収集するかを制御するための Users Allowlist と Blocklist。
# この設定では glob パターンはサポートされません。

# user_metrics_users_allowlist = []
# user_metrics_users_blocklist = []

exporter の起動(再起動)

systemctl start aerospike-prometheus-exporter.service
systemctl restart aerospike-prometheus-exporter.service

メトリクスへのアクセス

curl http://localhost:9145/metrics でメトリクスにアクセスします。

DataKit に aerospike-prom.conf 設定ファイルを追加

/usr/local/datakit/conf.d/samples ディレクトリで、prom.conf.sampleaerospike-prom.conf にコピーします。

cp prom.conf.sample aerospike-prom.conf

主なパラメータの説明

  • url:aerospike-prometheus-exporter のメトリクスアドレス
  • interval:収集頻度
  • source:コレクターの別名
[[inputs.prom]]
  urls = ["http://192.168.0.189:9145/metrics"]
  ## url へのリクエストエラーを無視
  ignore_req_err = false
  ## コレクターの別名
  source = "aerospike"
  metric_types = []
  measurement_prefix = ""
  ## 収集間隔 "ns", "us" (or "µs"), "ms", "s", "m", "h"
  interval = "10s"
  ## TLS 設定
  tls_open = false
  ## カスタム Tags
  [inputs.prom.tags]

DataKit の再起動

systemctl restart datakit

ログ収集

パラメータ説明

- logfiles:ログファイルのパス (通常はアクセスログとエラーログを指定)
- source:`aerospike` # データソース
- service:`aerospike` # サービス名

/usr/local/datakit/conf.d ディレクトリで、設定ファイルを 1 つコピーし、logging-aerospike.conf にリネームします。

cp logging.conf.sample logging-aerospike.conf

logging-aerospike.conf 全文

[[inputs.logging]]
## required
logfiles = [
"/var/log/aerospike/aerospike.log",
]

## glob filteer
ignore = [""]

## your logging source, if it's empty, use 'default'
source = "aerospike"

## add service tag, if it's empty, use $source.
service = "aerospike"

## grok pipeline script name
pipeline = ""

## optional status:
##   "emerg","alert","critical","error","warning","info","debug","OK"
ignore_status = []

## optional encodings:
##    "utf-8", "utf-16le", "utf-16le", "gbk", "gb18030" or ""
character_encoding = ""

## datakit read text from Files or Socket , default max_textline is 32k
## If your log text line exceeds 32Kb, please configure the length of your text,
## but the maximum length cannot exceed 32Mb
# maximum_length = 32766

## The pattern should be a regexp. Note the use of '''this regexp'''
## regexp link: https://golang.org/pkg/regexp/syntax/#hdr-Syntax
# multiline_match = '''^\S'''

## removes ANSI escape codes from text strings
remove_ansi_escape_codes = false

## if file is inactive, it is ignored
## time units are "ms", "s", "m", "h"
ignore_dead_log = "10m"

[inputs.logging.tags]
# some_tag = "some_value"
  # more_tag = "some_other_value"

メトリクス詳細

Aerospike 公式メトリクスを参照

フィードバック

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