moiot/moha(opens in a new tab)
Language: Go
MoHA(Mobike High Availability): A MySQL/Postgres high availability supervisor
- stars
- 134
- watchers
- 13
- forks
- 50
- open issues
- 9
- Last updated
- 10/17/2019
Language: Go
MoHA(Mobike High Availability): A MySQL/Postgres high availability supervisor
MoHA provides the high availability(HA) for cross-region MySQL clusters, by automating master failover and fast master switch.
High Availability
Master failure detection and automating master failover enables master switch in a few seconds.
Brain Split Prevention
By configuring proper lease ttl, MoHA enables at most one master in the cluster at any time.
Cross AZ Topology
Leveraging etcd as the service discovery, MoHA prevent its implementation from VIP, so that the cross-AZ MySQL cluster is able to be build via MoHA.
Multiple Standby
MoHA supports MySQL cluster with multiple standby servers, and ensures that the server with latest log will be promoted during failover.
Single Point Primary Mode
When there is only one MySQL surviving in the cluster, it is able to provide R/W services even if the communication to etcd is unstable or broken, which is called Single Point Primary Mode. MoHA enters and exits this mode automatically.
Manual Master/Slave Switch
Besides the automated failover, which is described below, MoHA provides the ability to switch master manually.
MoHA is Supporting Mobike Databases in Production
Docker image is already available on Dockerhub
Latest image tag is v2.4.0, run docker pull moiot/moha:v2.4.0 to pull the image
config and start/stop scripts refers to operation doc
Runtime Dependencies
cd $GOPATH mkdir -p src/github.com/moiot cd src/github.com/moiot git clone <remote_repo> moha cd moha
make init
make init does the following
depgolintgoimportsnow you can do development on your local machine
make env-up
make docker-agent make start-agents
make clean-data
This project is under the Apache 2.0 license. See the LICENSE file for details.