Giter Site home page Giter Site logo

ansible-postgresql_master-slave's Introduction

Vagrant and ansible to setup PostgreSQL 12 Master Slave replication on Ubuntu 20.04

This repo will create PostgreSQL single Master and Two Slave Cluster setup using Vagrant.

Ansible will perform the initial installation and also the configuration of Master-Slave replication configuration. If the PostgreSQL Master goes down then change the ansible hosts file i.e, move any server from db_slave group to db_master group and re-run the ansible command to promote slave as master.

Similarly new slave can be added later on by adding server to db_slave group in hosts file and run ansible playbook to perform the installation and configuration of slave server.

Prerequisites

Below software must be installed on the machine to run this automation

  1. Oracle VirtualBox
  2. Vagrant
  3. Ansible
  4. Git

[OPTIONAL] You can also download the Ubuntu 20.04 vagrant box with command vagrant box add ubuntu/focal64. If this step skipped then vagrant up command will first download vagrant box then create VM(s) from it.

Usage

First clone the repo

git clone https://github.com/m-adnan8080/ansible-postgresql_master-slave.git

Change directory to ansible-postgresql_master-slave

cd ansible-postgresql_master-slave
vagrant up
ansible-playbook pg_setup.yml

ansible-postgresql_master-slave's People

Contributors

m-adnan8080 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.