Files
nexus/wiki/entities/Netdata.md
2026-04-22 04:03:04 +08:00

77 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Netdata"
type: entity
aliases: [netdata, netdata cloud]
tags: [monitoring, real-time, visualization, self-hosted, linux]
date: 2025-11-11
---
# Netdata
## Overview
Netdata 是开源的实时性能和健康监控工具,以"开箱即用"为设计理念,无需复杂配置即可提供高分辨率的主机和容器监控面板。默认监听端口 19999提供交互式 Web 仪表盘。相比 Prometheus + Grafana 的组合Netdata 更适合快速诊断和实时观测,但不适合长期数据存储和趋势分析。
## Key Characteristics
- **零配置**:安装后自动发现并监控所有系统资源
- **实时高分辨率**:每秒采样,展示毫秒级性能波动
- **交互式仪表盘**:内置 Web UI支持缩放、筛选、对比
- **容器监控**:自动发现 Docker 容器并采集资源指标
- **可扩展**:支持通过 plugins 采集自定义指标
- **Prometheus 集成**:可作为 Prometheus 数据源,实现长期存储
## Home Server Deployment
```yaml
# docker-compose.yml来源learn.netdata.cloud
version: '3.8'
services:
netdata:
image: netdata/netdata:latest
container_name: netdata
hostname: home-server
restart: unless-stopped
ports:
- "19999:19999"
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- netdataconfig:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
environment:
- NETDATA_CLAIM_TOKEN=
- NETDATA_CLAIM_URL=http://localhost:19999/claim
```
访问 `http://localhost:19999` 查看实时监控仪表盘。
## Comparison: Netdata vs Prometheus
| 维度 | Netdata | Prometheus |
|------|---------|-----------|
| 采样频率 | 每秒 | 通常 15s+ |
| 数据保留 | 本地(默认 1h | 长期(可配置) |
| 查询语言 | 无Web UI | PromQL |
| 告警配置 | 内置 Web UI | Prometheus rules |
| 学习门槛 | 低 | 中 |
| 长期趋势分析 | 弱 | 强 |
| 适用场景 | 实时诊断、快速排查 | SLA 报表、历史分析 |
## Best Practice
Netdata + Prometheus 互补使用Netdata 做实时诊断Prometheus + Grafana 做长期存储和 SLA 报表。
## Related Sources
- [[家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]]
## Related Entities
- [[Prometheus]] — 长期存储方案
- [[Grafana]] — 可视化层
## Related Concepts
- [[System Monitoring]] — 上游领域
- [[时序数据库]] — Prometheus 的数据模型对比