GithubHelp home page GithubHelp logo

toddstoffel / rebuild_slave Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 3.0 23 KB

Automatically rebuild mariadb slaves quickly using this Ansible playbook

mariadb replication slave-replication mysql mariabackup streaming backup slave columnstore automatic

rebuild_slave's Introduction

logo

Automatic Replica Creation Utility For MariaDB

Description

This playbook will automatically create/rebuild and configure a replication slave. It can be run from any host that can access your database servers via SSH. This is designed to work on both MariaDB and MariaDB ColumnStore systems.

On the master, it will:

  1. Launch MariaBackup.
  2. Create a streaming snapshot of your data directory using xbstream/mbstream.
  3. Compress the stream with pigz.
  4. Stream to the slave via socat.

On the slave, it will:

  1. Receive the stream.
  2. Decompress.
  3. Prepare the backup.
  4. Find the GTID or binary log position.
  5. Register with the master.
  6. Start slave replication.

Prerequisites

  • Ansible
  • Git
  • Ports 4444 and 3306 must be open between your master and slave.
  • Port 22 must be open to your servers from whatever machine you run the playbook from.
  • Create replication user following this example:
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'idbrep'@'10.%' IDENTIFIED BY 'C0lumnStore!';

Setup

  • git clone https://github.com/toddstoffel/rebuild_slave.git
  • cd to cloned folder
  • Edit the inventory/hosts file with your own information
  • Edit the inventory/group_vars/all.yml file with your own information
  • Run ansible-playbook create_slave.yml

rebuild_slave's People

Contributors

toddstoffel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.