OpenGSLB Documentation
Open-source Global Server Load Balancer with DNS-based traffic management
OpenGSLB is an enterprise-grade DNS-based load balancer that provides intelligent traffic distribution across multiple backend servers. It uses a simplified agent-overwatch architecture for reliability and ease of operation.
Key Features
DNS-based Load Balancing: Route traffic using DNS responses without proxying
Multiple Routing Algorithms: Round-robin, weighted, failover, geolocation, and latency-based routing
Geolocation Routing: Route traffic based on client geographic location using MaxMind GeoIP2 databases with EDNS Client Subnet (ECS) support
Latency-Based Routing: Route to lowest-latency servers with exponential moving average (EMA) smoothing
Health Checking: HTTP, HTTPS, and TCP health checks with configurable thresholds
Agent-Overwatch Architecture: Distributed health monitoring with centralized DNS serving
DNSSEC Support: Cryptographic authentication of DNS responses
Predictive Health: CPU, memory, and error rate monitoring for proactive failover
External Overrides: API for CloudWatch, Watcher, or custom tool integration
Multi-File Configuration: Split configuration across multiple files with glob pattern support
CLI Management Tool: Command-line tool for status monitoring, overrides, and configuration validation
Architecture Overview
┌─────────────────────────────────────────────────────────┐
│ DNS Clients (resolv.conf with multiple nameservers) │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Overwatch1│ │Overwatch2│ │Overwatch3│ │
│ └─────┬────┘ └─────┬────┘ └─────┬────┘ │
│ │ │ │ │
│ └────────────┼────────────┘ │
│ │ Gossip │
│ ┌────────┼────────┐ │
│ ▼ ▼ ▼ │
│ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ Agent │ │ Agent │ │ Agent │ │
│ │ + App │ │ + App │ │ + App │ │
│ └────────┘ └────────┘ └────────┘ │
└─────────────────────────────────────────────────────────┘
Getting Started
Installation
# Clone the repository
git clone https://github.com/LoganRossUS/OpenGSLB.git
cd OpenGSLB
# Build
go build -o opengslb ./cmd/opengslb
# Run
./opengslb --config config.yaml
Basic Configuration
mode: overwatch
dns:
listen_address: "0.0.0.0:53"
zones:
- gslb.example.com
gossip:
bind_address: "0.0.0.0:7946"
encryption_key: "your-32-byte-base64-key"
validation:
enabled: true
check_interval: 30s
License
OpenGSLB is dual-licensed:
AGPLv3 - Free for open-source and internal use
Commercial License - Available for proprietary integration
See LICENSE for details.
Getting Started
- Configuration Reference
- Configuration File Security
- Runtime Mode (ADR-015)
- Agent Mode Configuration
- Overwatch Mode Configuration
- Configuration Sections
- Duration Format
- Complete Example
- Example Configurations
- Command Line Options
- Environment Variables
- Validation
- Weighted Routing
- Failover (Active/Standby) Routing
- Geolocation Routing
- Latency-Based Routing
- Learned Latency Routing (ADR-017)
- Configuration Hot-Reload
- Multi-File Configuration (Includes)
- IPv6 Support
- Docker Deployment Guide
- OpenGSLB CLI Reference
Demos
Architecture
- Architecture Decisions
- ADR-001: Use Go for Implementation
- ADR-002: DNS-Based Load Balancing Approach
- ⚠️ ADR-003: Health Check Architecture
- ADR-004: Configuration via YAML Files
- ADR-005: Pluggable Routing Algorithms
- ADR-006: Prometheus for Metrics
- ⚠️ ADR-007: Separate Control and Data Planes
- ADR-008: TTL-Based Failover Strategy
- ADR-009: Unhealthy Server Response Strategy
- ADR-010: DNS Library Selection
- ADR-011: Router Terminology for Server Selection
- ⚠️ ADR-012: Distributed Agent Architecture & HA Control Plane
- ⚠️ ADR-013: Hybrid Configuration & KV Store Strategy
- ⚠️ ADR-014: Runtime Mode Semantics
- ADR-015: Agent-Overwatch Architecture
- ADR-016: Unified Server Registration and Service-to-Domain Mapping
- ADR-017: Passive Latency Learning via OS TCP Statistics
- ADR-018: Anycast Node Discovery (Optional)
- Document History
- Agent-Overwatch Deployment Guide
- Gossip Protocol
API Reference
- OpenGSLB API Reference
- Table of Contents
- Security & Authentication
- Configuration
- Simple Health Check
- Core Health Endpoints
- Liveness & Readiness Probes
- Version Endpoint
- Domain API
- Server API
- Region API
- Node API
- Gossip API
- Audit Log API
- Metrics API
- Config API
- Routing API
- Override API
- DNSSEC API
- Overwatch API
- Error Responses
- Usage Examples
- OpenGSLB Metrics Reference
Security