Git Product home page Git Product logo

openshift-galera-mariadb's Introduction

OpenShift Galera MariaDB Cartridge

This is an OpenShift cartridge which will give you the end result of a 3 gear MariaDB Galera cluster, it can technically scale up to as many gears as possible (within reason). It requires this HAProxy cartridge [1]

Quick Steps:

rhc -s app create mariadb php-5.3 # or any other web cartridge (it must be a scaled cartridge)
rhc cartridge add https://raw.githubusercontent.com/andrewklau/openshift-haproxy-galera-mariadb/master/metadata/manifest.yml -a mariadb
rhc cartridge add https://raw.github.com/andrewklau/openshift-galera-mariadb/master/metadata/manifest.yml -a mariadb
rhc app show mariadb --gears

Now you can ssh into your gears and you'll see your lovely lovely mariadb cluster connected and waiting to be thrashed with load.

Status: Working!

What's Different:

  • MariaDB Galera cluster requires 1 extra ports (galera - 4567) this is handled by hooks to save them as env variables to be shared across the cluster. Galera can also use rsync for it's SST (state snapshot transfer) on port 4444 however mysqldump has proven to be a little more reliable in OpenShift
  • Modified wsrep_sst_mysqldump

To Do:

  • Verify logic and possible loops or data corruption (I'd really appreciate a second pair of eyes)
  • Do the upgrade/snapshot/backup scripts
  • Improve HAProxy config files
  • Move more files to locked_files

Ideally:

  • Setup proper version control so for nodes with the correct packages installed can get automatically updates (need more research)
  • Create another embeded haproxy cartridge for loadbalancing and split-brain prevention(done!!)
  • Setup SSL for the mysqldump (need more research)
  • Add a wsrep_notify_cmd script to notify users if gears go down etc.

Feedback:

I'm not a developer, but I'm learning so I appreciate any feedback and any code comments you have. If you see something absolutely horrible, please tell me so I can improve :)

Disclaimer:

  • Normal disclaimer, I'm doing this for my own personal learning and gain, with the hopes that this will also help another.
  • Possibly become something which will be used in production environments.
  • However with the nature of database replication software, I'm not responssible for data loss or anything while using this cartridge.
  • Although I've tried very hard to prevent all possible common pitfalls.

Kudos:

  • warthog9@openshift-dev
  • jhonce@openshift-dev
  • blackdan@mariadb
  • mateus@getupcloud

[1] https://github.com/andrewklau/openshift-haproxy-galera-mariadb

openshift-galera-mariadb's People

Contributors

andrewklau avatar aaam avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.