콘텐츠로 이동

Aerospike


·


Aerospike Namespace 성능 지표를 보여주며, 클러스터와 namespace의 메모리 사용량, 디스크 사용량, 객체 수, 읽기/쓰기 속도 등을 포함합니다.

Aerospike Node 관련 지표를 보여주며, Node 클러스터, Node 상태, 레코드 수, 메모리, 디스크 지표 등을 포함합니다.

설치 및 설정

사전 조건

  • Aerospike가 설치되어 있어야 합니다

예시 Aerospike 버전은 Linux 환경 6.0.0 (CentOS)이며, 버전에 따라 각 지표가 다를 수 있습니다.

aerospike-prometheus-exporter 는 Aerospike를 빠르게 모니터링에 연동할 수 있도록 공식에서 개발한 Exporter입니다.

메트릭 수집

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) configuration
# HTTPS between Prometheus and Exporter

# TLS certificates.
# Supports below formats,
# 1. Certificate file path                                      - "file:<file-path>"
# 2. Environment variable containing base64 encoded certificate - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
# 3. Base64 encoded certificate                                 - "b64:<base64-encoded-certificate>"
# Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.

# Server certificate
cert_file = ""

# Private key associated with server certificate
key_file = ""

# Root CA to validate client certificates (for mutual TLS)
root_ca = ""

# Passphrase for encrypted key_file. Supports below formats,
# 1. Passphrase directly                                                      - "<passphrase>"
# 2. Passphrase via file                                                      - "file:<file-that-contains-passphrase>"
# 3. Passphrase via environment variable                                      - "env:<environment-variable-that-holds-passphrase>"
# 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Passphrase in base64 encoded form                                        - "b64:<base64-encoded-passphrase>"
key_file_passphrase = ""

# labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"}
labels = {}

bind = ":9145"

# metrics server timeout in seconds
timeout = 10

# Exporter logging configuration
# Log file path (optional, logs to console by default)
# Level can be info|warning,warn|error,err|debug|trace ('info' by default)
log_file = ""
log_level = ""

# Basic HTTP authentication for '/metrics'.
# Supports below formats,
# 1. Credential directly                                                      - "<credential>"
# 2. Credential via file                                                      - "file:<file-that-contains-credential>"
# 3. Credential via environment variable                                      - "env:<environment-variable-that-contains-credential>"
# 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Credential in base64 encoded form                                        - "b64:<base64-encoded-credential>"
basic_auth_username = ""
basic_auth_password = ""

[Aerospike]
db_host = "localhost"
db_port = 3000

# TLS certificates.
# Supports below formats,
# 1. Certificate file path                                      - "file:<file-path>"
# 2. Environment variable containing base64 encoded certificate - "env-b64:<environment-variable-that-contains-base64-encoded-certificate>"
# 3. Base64 encoded certificate                                 - "b64:<base64-encoded-certificate>"
# Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.

# root certificate file
root_ca = ""

# certificate file
cert_file = ""

# key file
key_file = ""

# Passphrase for encrypted key_file. Supports below formats,
# 1. Passphrase directly                                                      - "<passphrase>"
# 2. Passphrase via file                                                      - "file:<file-that-contains-passphrase>"
# 3. Passphrase via environment variable                                      - "env:<environment-variable-that-holds-passphrase>"
# 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Passphrase in base64 encoded form                                        - "b64:<base64-encoded-passphrase>"
key_file_passphrase = ""

# node TLS name for authentication
node_tls_name = ""

# Aerospike cluster security credentials.
# Supports below formats,
# 1. Credential directly                                                      - "<credential>"
# 2. Credential via file                                                      - "file:<file-that-contains-credential>"
# 3. Credential via environment variable                                      - "env:<environment-variable-that-contains-credential>"
# 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Credential in base64 encoded form                                        - "b64:<base64-encoded-credential>"
# Applicable to 'user' and 'password' configurations.

# database user
user = ""

# database password
password = ""

# authentication mode: internal (for server), external (LDAP, etc.)
auth_mode = ""

# timeout for sending commands to the server node in seconds
timeout = 5

# Number of histogram buckets to export for latency metrics. Bucket thresholds range from 2^0 to 2^16 (17 buckets).
# e.g. latency_buckets_count=5 will export first five buckets i.e. <=1ms, <=2ms, <=4ms, <=8ms and <=16ms.
# Default: 0 (export all threshold buckets).
latency_buckets_count = 0

# Metrics Allowlist - If specified, only these metrics will be scraped. An empty list will exclude all metrics.
# Commenting out the below allowlist configs will disable metrics filtering (i.e. all metrics will be scraped).

# Namespace metrics allowlist
# namespace_metrics_allowlist = []

# Set metrics allowlist
# set_metrics_allowlist = []

# Node metrics allowlist
# node_metrics_allowlist = []

# XDR metrics allowlist (only for Aerospike versions 5.0 and above)
# xdr_metrics_allowlist = []

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

# Secondary index metrics allowlist
# sindex_metrics_allowlist = []

# Metrics Blocklist - If specified, these metrics will be NOT be scraped.

# Namespace metrics blocklist
# namespace_metrics_blocklist = []

# Set metrics blocklist
# set_metrics_blocklist = []

# Node metrics blocklist
# node_metrics_blocklist = []

# XDR metrics blocklist (only for Aerospike versions 5.0 and above)
# xdr_metrics_blocklist = []

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

# Secondary index metrics blocklist
# sindex_metrics_blocklist = []

# Users Statistics (user statistics are available in Aerospike 5.6+)
# Users Allowlist and Blocklist to control for which users their statistics should be collected.
# Note globbing patterns are not supported for this configuration.

# 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.sample을 복사해 aerospike-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:로그 파일 경로 (보통 access log와 error log를 입력)
- source:`aerospike` # 데이터 소스
- service:`aerospike` # 서비스명

/usr/local/datakit/conf.d 디렉터리에서 conf 파일을 하나 복사해 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 공식 지표 참고

문서 평가

이 페이지가 도움이 되었나요?