neoha

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: Apache-2.0

README

NeoHA Build NeoHA Test NeoHA Coverage Go Reference codecov

NeoHA

NeoHA is a template for MySQL and PostgreSQL High Availability with Etcd, Consul, ZooKeeper, or Kubernetes written in Golang, inspired by zalando/patroni and radondb/xenon.

Authors

Copyright 2022-2026 The NeoHA Authors. See AUTHORS for contributor details.

Licensed under the Apache License, Version 2.0. See LICENSE.

Documentation

Topic Document
Architecture (L1–L5, Coordinator / Driver / Reconciler) docs/architecture.md
MySQL HA failover (3-node semi-sync & MGR: minority / majority loss, sequence diagrams) docs/ha-failover.md
Config schema & validation docs/config-design.md
Deployment (build, 3-node wiring, neohactl, checklists) docs/deployment.md
Roadmap & IT notes docs/TODO.md
Integration test harness test/integration/README.md

Unit Tests

make test      # unit tests (~5 min; raft package is the slowest)
make coverage  # unit-test coverage (~8–15 min; raft alone ~5–10 min with -covermode=atomic)

CI runs make build, make test, and make coverage-ci on push/PR to main (see .github/workflows/).

Integration Tests

Requires MySQL 8.0 debug build, optional Xtrabackup + SSH for backup tests. See test/integration/README.md.

cp test/integration/it.local.yaml.example test/integration/it.local.yaml
make test-integration

Directories

Path Synopsis
api
v1
cmd
neoha command
neohactl command
internal
coordination
Package coordination defines the L2 cluster coordination abstraction.
Package coordination defines the L2 cluster coordination abstraction.
coordination/etcd
Package etcd provides an etcd-backed coordination.Coordinator (Patroni-style leader lease).
Package etcd provides an etcd-backed coordination.Coordinator (Patroni-style leader lease).
coordination/raftadapter
Package raftadapter wraps internal/election/raft as coordination.Coordinator.
Package raftadapter wraps internal/election/raft as coordination.Coordinator.
coordination/wire
Package wire constructs coordination.Coordinator implementations from config.
Package wire constructs coordination.Coordinator implementations from config.
database/driver
Package driver defines the L4 database abstraction for HA orchestration.
Package driver defines the L4 database abstraction for HA orchestration.
ha
Package ha implements the L3 reconcile loop (Patroni-style run_cycle).
Package ha implements the L3 reconcile loop (Patroni-style run_cycle).
test
integration/harness
Package harness orchestrates databases and NeoHA nodes for integration tests.
Package harness orchestrates databases and NeoHA nodes for integration tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL