Code Monkey home page Code Monkey logo

mariadb-galera-ansible's Introduction

Deploy the Galera Cluster.

A Multi-Master Cluster of MariaDB based on synchronous replication.

Description

Galera Cluster is a synchronous multi-master replication plug-in for InnoDB. It is very different from the regular MySQL Replication, and addresses a number of issues including write conflicts when writing on multiple masters, replication lag and slaves being out of sync with the master. Users do not have to know which server they can write to (the master) and which servers they can read from (the slaves).

Getting Started

ansible-playbook -i inventories/galera/test-db/hosts galera.yml -e 'first_time=true'

Variables

Variable Default Description
ip - private IP of the VM
dns_domain - specify the hostname of the node VM
mariadb_version - specify the version of MariaDB to be installed.
galera_cluster_name 10.5 specify wsrep_cluster_name.
first_time false is the custom environment variable defined to determine if its first run to setup the cluster.
mysql_root_password - specify mariadb root password.
innodb_buffer_pool_size 512M set innodb_buffer_pool_size for MariaDB.
mariadb_repo_url default_link It is repository_url, a URL to the directory where the repodata directory of a MariaDB repository is located.

Tested Versions

Troubleshooting

Recover a MariaDB Galera Cluster Node due to Database Corruption

  • First make sure other nodes are running well and follow these instructions.
  • Navigate to mysql folder using cd /var/lib/mysql/
  • Create a new directory using mkdir /fioldername
  • Copy the whole folder mysql using rsync -avz . /foldername/
  • Remove all the files in mysql folder using rm -rf *
  • Again copy the mysql DB from backup folder to mysql folder using cp -rpf /foldername/mysql .
  • Add innodb_force_recovery=1 in /etc/my.cnf.d/server.cnf file
  • Add TimeoutSec variable in /etc/systemd/system/mysql.service file
  • The above TimeoutSec variable value should be mentioned in secs TimeoutSec=900
  • Now start the service systemctl start mariadb
  • You can check the status of cluster using systemctl status mariadb
  • Once the cluster is up just comment innodb_force_recovery=1 in server.cnf file
  • Then again restart the cluster using systemctl restart mariadb

mariadb-galera-ansible's People

Contributors

saravanan30erd avatar unnisathyarajan 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.