A Go port of corosync-qnetd, optimized for embedded devices with minimal dependencies.
Go-QNetd is a quorum device network daemon that provides votes to Corosync clusters. It's designed to:
- Run outside the cluster as a vote provider
- Support multiple clusters dynamically (no configuration file)
- Use a TLV-based protocol over TCP/TLS
- Implement quorum decision algorithms (FFSplit, LMS, 2NodeLMS, Test)
- Operate with minimal resource usage for embedded deployments
- ✅ 100% binary protocol compatibility with C
corosync-qdevice - ✅ Pure Go implementation (no C dependencies)
- ✅ All 18 message types supported
- ✅ All 4 decision algorithms implemented (FFSplit, LMS, 2NodeLMS, Test)
- ✅ TLS support via Go's
crypto/tls(Phase 5: TLS upgrade pending) - ✅ Minimal binary size and memory footprint
- ✅ Event-driven architecture for efficiency
- ✅ Comprehensive CLI flags matching C implementation
- ✅ Daemonization support (Unix systems)
- ✅ Fuzzing tests for protocol robustness
- ✅ Runtime-configurable log levels
Phases 1-4 Complete: Foundation, Network Layer, Protocol Implementation, and Algorithms
Phase 6 In Progress: Integration & Polish (CLI flags, fuzzing, documentation)
Phase 5 Pending: TLS & Certificates (TLS upgrade, certutil tool)
See PROJECT_PLAN.md for detailed implementation status.
- Go 1.25 or later
- Make (optional, for convenience targets)
# Build both binaries
make build
# Run tests
make test
# Run fuzzing tests (Go 1.18+)
make fuzz
# Format code
make fmt
# Run linter
make vet
# Clean build artifacts
make clean# Build daemon
CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o bin/qnetd ./cmd/qnetd
# Build certutil
CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -o bin/qnetd-certutil ./cmd/qnetd-certutilgo-qnetd/
├── cmd/ # Application entry points
│ ├── qnetd/ # Main daemon
│ └── qnetd-certutil/ # Certificate management tool
├── internal/ # Internal packages
│ ├── protocol/ # Protocol implementation (TLV, messages)
│ ├── server/ # Server core, event loop, connections, clusters
│ │ ├── algorithm/ # Decision algorithms (FFSplit, LMS, 2NodeLMS, Test)
│ │ ├── connection.go # Client connection management
│ │ ├── cluster.go # Cluster management
│ │ ├── handlers.go # Message handlers
│ │ └── ... # Server implementation files
│ └── logger/ # Custom logger
├── docs/ # Documentation
└── Makefile # Build automation
- Project Plan - Implementation phases and decisions
- Architecture - System architecture and design
BSD-3-Clause (same as original corosync-qdevice)
- Original C implementation: https://github.com/corosync/corosync-qdevice
- Corosync documentation: https://corosync.github.io/corosync/