All Projects → moiot → Moha

moiot / Moha

Licence: apache-2.0
MoHA(Mobike High Availability): A MySQL/Postgres high availability supervisor

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Moha

Stolon
PostgreSQL cloud native High Availability and more.
Stars: ✭ 3,481 (+2875.21%)
Mutual labels:  postgresql, etcd, high-availability
Postgresql cluster
PostgreSQL High-Availability Cluster (based on "Patroni" and "DCS(etcd)"). Automating deployment with Ansible.
Stars: ✭ 294 (+151.28%)
Mutual labels:  postgresql, etcd, high-availability
Pifpaf
Python fixtures and daemon managing tools for functional testing
Stars: ✭ 161 (+37.61%)
Mutual labels:  mysql, postgresql, etcd
Patroni
A template for PostgreSQL High Availability with Etcd, Consul, ZooKeeper, or Kubernetes
Stars: ✭ 4,434 (+3689.74%)
Mutual labels:  postgresql, etcd, high-availability
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-12.82%)
Mutual labels:  mysql, postgresql
Servicestack.ormlite
Fast, Simple, Typed ORM for .NET
Stars: ✭ 1,532 (+1209.4%)
Mutual labels:  mysql, postgresql
Sql Kit
*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
Stars: ✭ 115 (-1.71%)
Mutual labels:  mysql, postgresql
Haproxy Configs
80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, Hue, ZooKeeper, SSH, RabbitMQ, Redis, Riak, Cloudera, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, Rancher etc.
Stars: ✭ 106 (-9.4%)
Mutual labels:  mysql, postgresql
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (-21.37%)
Mutual labels:  mysql, postgresql
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (-13.68%)
Mutual labels:  mysql, postgresql
Blog
我的日记
Stars: ✭ 110 (-5.98%)
Mutual labels:  mysql, etcd
Openseedbox
OpenSeedbox - Open Source Multi-User Bittorrent Web UI
Stars: ✭ 101 (-13.68%)
Mutual labels:  mysql, postgresql
Adminer Custom
Customizations for Adminer, the best database management tool written in PHP.
Stars: ✭ 99 (-15.38%)
Mutual labels:  mysql, postgresql
Akka Persistence Sql Async
A journal and snapshot store plugin for akka-persistence using RDBMS.
Stars: ✭ 115 (-1.71%)
Mutual labels:  mysql, postgresql
Leoric
👑 JavaScript ORM for MySQL, PostgreSQL, and SQLite.
Stars: ✭ 94 (-19.66%)
Mutual labels:  mysql, postgresql
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-11.11%)
Mutual labels:  mysql, postgresql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-5.13%)
Mutual labels:  mysql, postgresql
Bireme
Bireme is an incremental synchronization tool for the Greenplum / HashData data warehouse
Stars: ✭ 110 (-5.98%)
Mutual labels:  mysql, postgresql
Honeyeql
HoneyEQL is a Clojure library enables you to query database using the EDN Query Language.
Stars: ✭ 111 (-5.13%)
Mutual labels:  mysql, postgresql
Tcpdp
tcpdp is TCP dump tool with custom dumper and structured logger written in Go.
Stars: ✭ 114 (-2.56%)
Mutual labels:  mysql, postgresql

moha_logo

Build Status Go Report Card License

What is Mobike High Availability(MoHA)? 中文

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

Quick Start

Run 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

  • Docker recommended with the latest version
  • etcd with version no earlier than 3.3.2

One AZ Example 1az

Three AZs Example 3az

Download Source Code

cd $GOPATH
mkdir -p src/github.com/moiot
cd src/github.com/moiot
git clone <remote_repo> moha
cd moha

Development Environment Setup

make init

make init does the following

  • check and install dep
  • check and install golint
  • check and install goimports
  • add git commit hook
  • prepare testing framework

now you can do development on your local machine

Local Machine Running Environment Setup

make env-up

Create Local Machine Running Agents, AKA Test Code on Local Machine

make docker-agent
make start-agents

Local Machine Running Environment Destroy

make clean-data

Roadmap

Roadmap

License

This project is under the Apache 2.0 license. See the LICENSE file for details.

Acknowledgments

  • Thanks rxi for the lightweight log framework
  • Thanks juju/errors for the error handling framework
  • Thanks yubai for his Lease analysis
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].