Compare commits

..

2 Commits

Author SHA1 Message Date
0fb6714a25 minor fixes 2025-10-21 19:52:14 +05:30
e5fe1c48ad segregrated manager node services 2025-10-21 19:46:30 +05:30
2 changed files with 4 additions and 170 deletions

163
README.md
View File

@@ -1,163 +0,0 @@
# 🏗️ Private Server Monitoring Stack — Aetoskia Infrastructure
This repository defines a private, self-hosted server monitoring stack running on Raspberry Pi nodes and other servers, consisting of:
* **Netdata** for system and container metrics
* **Portainer** for container management and orchestration
This setup allows a central **manager server** to monitor all nodes while providing dashboards and management UI accessible via HTTPS.
---
## 🧬 Services Overview
| Service | Role | Port(s) | Depends On |
| --------------- | --------------------------------------- | ------- | ------------------- |
| netdata | System monitoring dashboard & master | 7001 | — |
| netdata_node | Node agent streaming metrics to master | 7003 | netdata (manager) |
| portainer | Container management UI & API | 7002 | — |
| portainer_agent | Node agent for remote Docker management | 9001 | portainer (manager) |
---
## ⚙️ Service Details
### 🐳 Netdata Manager
Central monitoring server collecting metrics from all connected nodes and exposing dashboards.
**Ports**
* 7001 → 19999 — Web dashboard (HTTPS handled via reverse proxy)
**Mounts**
* `netdata_config:/etc/netdata` — Persistent Netdata configuration
* `netdata_lib:/var/lib/netdata` — Persistent Netdata metrics database
* `netdata_cache:/var/cache/netdata` — Cache storage
**Environment**
* `NETDATA_CLAIM_TOKEN` — Optional claim token for Netdata Cloud
* `NETDATA_CLAIM_URL=https://app.netdata.cloud`
**Profiles**
* `netdata-manager` — Manager profile (always acts as manager + local node)
---
### 🐳 Netdata Node
Agent container that streams metrics to the manager server.
**Ports**
* 7003 → 19999 — Local dashboard (optional)
**Environment**
* `NETDATA_STREAM_PARENT=https://netdata.aetoskia.com` — Manager endpoint
* `NETDATA_CLAIM_TOKEN` — Optional claim token
* `NETDATA_CLAIM_URL=https://app.netdata.cloud`
**Profiles**
* `netdata-node` — Node-only profile
---
### 🦾 Portainer Manager
Central container management UI and API server, visualizing Docker nodes and stacks.
**Ports**
* 7002 → 9000 — Portainer web UI
**Mounts**
* `/var/run/docker.sock:/var/run/docker.sock:ro` — Access local Docker
* `portainer_data:/data` — Persistent Portainer data
**Profiles**
* `portainer-manager` — Manager profile
---
### 🦾 Portainer Agent
Node agent that registers with the Portainer manager to allow remote Docker management.
**Ports**
* 9001 → 9001 — Agent API
**Mounts**
* `/var/run/docker.sock:/var/run/docker.sock` — Access local Docker
* `portainer_agent_data:/data` — Persistent agent data
**Profiles**
* `portainer-agent` — Node-only profile
---
## 🧬 Network Integration
Ensure `/etc/hosts` on all relevant devices (Pi nodes, servers) includes:
```
192.168.1.35 netdata.aetoskia.com
192.168.1.35 portainer.aetoskia.com
```
* **Netdata manager** receives metrics from `netdata_node` agents
* **Portainer manager** manages `portainer_agent` nodes
---
## 🧠 Usage
### Manager Server
Start manager services (also acts as local node):
```bash
docker compose --profile netdata-manager --profile portainer-manager down --remove-orphans && docker compose --profile netdata-manager --profile portainer-manager up -d
```
### Node Server
Start agent/node services:
```bash
docker compose --profile netdata-node --profile portainer-agent down --remove-orphans && docker compose --profile netdata-node --profile portainer-agent up -d
```
---
## ✅ Quick Test Checklist
| Component | URL | Expected Result |
| --------------- | -------------------------------------------------------------------------- | ------------------------------------------------------- |
| Netdata Manager | [https://netdata.aetoskia.com:7001](https://netdata.aetoskia.com:7001) | Dashboard showing metrics for manager + connected nodes |
| Portainer | [https://portainer.aetoskia.com:7002](https://portainer.aetoskia.com:7002) | Portainer UI showing manager + registered nodes |
| Netdata Node | https://<node_ip>:7003 | Node metrics accessible locally |
| Portainer Agent | Internal agent API | Registered under manager UI |
---
## 🧠 Tips
* **Manager profile** always acts as **manager + local node**.
* **Node profile** only runs **agent containers**, never acts as manager.
* Use **Docker Compose profiles** to cleanly separate roles.
* Reverse proxy (HTTPS) is recommended for dashboard access.
* Persistent mounts ensure that configuration and metrics survive container restarts.
---
© Aetoskia Internal Infrastructure — All rights reserved.

View File

@@ -5,7 +5,6 @@ services:
netdata: netdata:
image: netdata/netdata:latest image: netdata/netdata:latest
container_name: netdata container_name: netdata
hostname: Private-Pi-Manager
ports: ports:
- "7001:19999" - "7001:19999"
cap_add: cap_add:
@@ -25,7 +24,7 @@ services:
- /etc/group:/host/etc/group:ro - /etc/group:/host/etc/group:ro
- /etc/os-release:/host/etc/os-release:ro - /etc/os-release:/host/etc/os-release:ro
environment: environment:
- NETDATA_CLAIM_TOKEN=baiLAOz-VoOsvVNhG1CLi6j14rL3bmYtWHIEfwfRFRX5VhnQDUxpSvKQ3WsSrH2lRw-obUX2tWxIepN9BrYHUppnXfkPndpLCeeDwH4P0ItJ7twkCL77XPnMcQnL8hqN9pBpFIs - NETDATA_CLAIM_TOKEN=${NETDATA_CLAIM_TOKEN:-}
- NETDATA_CLAIM_URL=https://app.netdata.cloud - NETDATA_CLAIM_URL=https://app.netdata.cloud
networks: networks:
- monitoring-net - monitoring-net
@@ -76,9 +75,8 @@ services:
# Netdata Agent # Netdata Agent
# -------------------------- # --------------------------
netdata_node: netdata_node:
image: netdata/netdata:edge image: netdata/netdata:latest
container_name: netdata_agent container_name: netdata_node
hostname: Server-Pi-Node
restart: unless-stopped restart: unless-stopped
ports: ports:
- "7003:19999" - "7003:19999"
@@ -100,9 +98,8 @@ services:
- /etc/os-release:/host/etc/os-release:ro - /etc/os-release:/host/etc/os-release:ro
environment: environment:
- NETDATA_STREAM_PARENT=https://netdata.aetoskia.com - NETDATA_STREAM_PARENT=https://netdata.aetoskia.com
- NETDATA_CLAIM_TOKEN=baiLAOz-VoOsvVNhG1CLi6j14rL3bmYtWHIEfwfRFRX5VhnQDUxpSvKQ3WsSrH2lRw-obUX2tWxIepN9BrYHUppnXfkPndpLCeeDwH4P0ItJ7twkCL77XPnMcQnL8hqN9pBpFIs - NETDATA_CLAIM_TOKEN=${NETDATA_CLAIM_TOKEN:-}
- NETDATA_CLAIM_URL=https://app.netdata.cloud - NETDATA_CLAIM_URL=https://app.netdata.cloud
- NETDATA_CLAIM_ROOMS=2fe293fe-ebff-43b9-9ad4-0b2206d29d26
networks: networks:
- monitoring-net - monitoring-net
profiles: profiles: