new three layer deployment
This commit is contained in:
82
ctrl/README.md
Normal file
82
ctrl/README.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# Deployment Configurations
|
||||
|
||||
This directory contains deployment configurations for sysmonstm.
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ Collector │────▶│ Hub │────▶│ Edge │────▶│ Browser │
|
||||
│ (mcrn) │ │ (local) │ │ (AWS) │ │ │
|
||||
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
||||
┌─────────────┐ │
|
||||
│ Collector │────────────┘
|
||||
│ (nfrt) │
|
||||
└─────────────┘
|
||||
```
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
ctrl/
|
||||
├── collector/ # Lightweight agent for each monitored machine
|
||||
├── hub/ # Local aggregator (receives from collectors, forwards to edge)
|
||||
├── edge/ # Cloud dashboard (public-facing, receives from hub)
|
||||
└── dev/ # Full gRPC stack for development
|
||||
```
|
||||
|
||||
## Production Deployment (3-tier)
|
||||
|
||||
### 1. Edge (AWS)
|
||||
Public-facing dashboard that receives metrics from hub.
|
||||
|
||||
```bash
|
||||
cd ctrl/edge
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### 2. Hub (Local Server)
|
||||
Runs on your local network, receives from collectors, forwards to edge.
|
||||
|
||||
```bash
|
||||
cd ctrl/hub
|
||||
EDGE_URL=wss://sysmonstm.mcrn.ar/ws EDGE_API_KEY=xxx docker compose up -d
|
||||
```
|
||||
|
||||
### 3. Collectors (Each Machine)
|
||||
Run on each machine you want to monitor.
|
||||
|
||||
```bash
|
||||
docker run -d --name sysmonstm-collector --network host \
|
||||
-e HUB_URL=ws://hub-machine:8080/ws \
|
||||
-e MACHINE_ID=$(hostname) \
|
||||
-e API_KEY=xxx \
|
||||
registry.mcrn.ar/sysmonstm/collector:latest
|
||||
```
|
||||
|
||||
## Development (Full Stack)
|
||||
|
||||
For local development with the complete gRPC-based architecture:
|
||||
|
||||
```bash
|
||||
# From repo root
|
||||
docker compose up
|
||||
```
|
||||
|
||||
This runs: aggregator, gateway, collector, alerts, redis, timescaledb
|
||||
|
||||
## Environment Variables
|
||||
|
||||
### Collector
|
||||
- `HUB_URL` - WebSocket URL of hub (default: ws://localhost:8080/ws)
|
||||
- `MACHINE_ID` - Identifier for this machine (default: hostname)
|
||||
- `API_KEY` - Authentication key
|
||||
- `INTERVAL` - Seconds between collections (default: 5)
|
||||
|
||||
### Hub
|
||||
- `API_KEY` - Key required from collectors
|
||||
- `EDGE_URL` - WebSocket URL of edge (optional, for forwarding)
|
||||
- `EDGE_API_KEY` - Key for authenticating to edge
|
||||
|
||||
### Edge
|
||||
- `API_KEY` - Key required from hub
|
||||
Reference in New Issue
Block a user