FastDFS
FastDFS의 지표 데이터를 수집합니다
설치 및 설정¶
사전 조건¶
- DataKit 설치
- Python >= 3.10
- Gunicorn = 23.0.0
- Flask = 3.1.0
- Prometheus_client = 0.21.1
fastdfs-exporter 다운로드¶
fastdfs-exporter는 FastDFS 상태를 Prometheus 지표 형식으로 변환하는 공식 개발 전용 Exporter입니다:
- exporter 디렉터리를 /etc 디렉터리로 이동한 뒤, 다음 명령으로 exporter.main을 실행합니다
- Exporter를 백그라운드 실행으로 설정합니다
- 시작 후
127.0.0.1:9036/metrics를 통해 지표에 접근할 수 있습니다
DataKit 수집기 설정¶
FastDFS는 JMX Exporter를 통해 metrics url을 직접 노출할 수 있으므로, prom 수집기로 직접 수집할 수 있습니다.
DataKit 설치 디렉터리 아래의 conf.d/samples로 이동한 뒤, 다음 명령을 실행합니다:
cp prom.conf.sample prom-fastdfs.conf.conf
prom-fastdfs.conf 내용을 조정하며, 주로 urls를 조정합니다. 예시는 다음과 같습니다:
[[inputs.prom]]
## Exporter URLs.
urls = ["http://127.0.0.1:9036/metrics"]
## Stream Size.
## The source stream segmentation size, (defaults to 1).
## 0 source stream undivided.
# stream_size = 1
## Unix Domain Socket URL. Using socket to request data when not empty.
uds_path = ""
## Ignore URL request errors.
ignore_req_err = false
## Collector alias.
source = "fastdfs"
기타 설정은 필요에 따라 조정, 매개변수 설명:
- urls:
prometheus지표 주소, 여기에는 해당 구성 요소가 노출한 지표 url을 입력합니다 - source: 수집기 별칭, 구분이 가능하도록 설정하는 것을 권장합니다
- interval: 수집 간격
Datakit 재시작¶
지표¶
| 지표 | 설명 | 단위 |
|---|---|---|
storage_join_time_seconds |
스토리지 서버가 클러스터에 합류한 시간. 이 값이 true일 때, 네임스페이스는 클라이언트 쓰기를 중지합니다 | Int |
storage_up_time_seconds |
스토리지 서버의 마지막 시작 시간(또는 최근 재시작 시간) | Int |
storage_total_space_bytes |
스토리지 서버의 총 디스크 공간 | Int |
free_space_bytes |
스토리지 서버의 사용 가능한 디스크 공간 | Int |
storage_connection_alloc_count |
누적 할당된 연결 수(시작 이후) | Int |
storage_connection_current_count |
현재 사용 중인 연결 수 | Int |
storage_connection_max_count |
허용되는 최대 연결 수 | Int |
storage_total_delete_count |
총 파일 삭제 횟수 | Int |
storage_success_download_count |
파일 다운로드 성공 횟수 | Int |
storage_total_modify_count |
총 파일 수정 횟수 | Int |
group_storage_server_count |
storage group 스토리지 서버 수 | Int |
group_active_storage_server_count |
storage group에서 실행 중인 스토리지 서버 수 | Int |
group_disk_total_space_bytes |
storage group 총 디스크 | Int |
group_disk_free_space_bytes |
storage group 남은 디스크 | Int |