GithubHelp home page GithubHelp logo

moemen / ansible-pgbouncer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balanced-ops/ansible-pgbouncer

0.0 2.0 0.0 112 KB

Installs and configures PGBouncer via Ansible

License: Apache License 2.0

ansible-pgbouncer's Introduction

Ansible PGBouncer playbook

Build Status

This is an Ansible playbook for deploying PGBouncer

This playbook was tested on Ubuntu 12.04 x86_64.

Features

  • Install PGBouncer
  • Installs newrelic monitoring for PGBouncer
  • Installs monit monitoring and alerting for PGBouncer

Requirements

This playbook requires Ansible 1.2 or higher.

Running playbook

ansible-playbook -i ansible.host ./tasks/main.yml

Notes

  • We recommend using a proper newrelic plugin like https://github.com/sivel/ansible-newrelic.git as well if you go the newrelic route

  • Monit needs to be configured fully in order for you to receive email alerts etc.

  • Configure databases like this

    pgbouncer_aliases:
      - name: balanced_integration
        host: db-integration-prod-mppbhl-p01.us-west-1.vandelay.io
        port: 5432
        db_name: balanced
      - name: balanced_live
        host: balanced-db-03
        port: 5432
  • Connect to the stats interface like this psql -p 6432 -h host pgbouncer -U pgbouncer

Pausing and resuming traffic

One of the most useful things about PGBouncer is the ability to pause and resume database connections.

This makes it easier for you to do DB maintenance and other work while minimising interruption to clients of the databases.

This playbook includes some ad-hoc commands that can be run to pause and resume database connectivity as part of this process.

You can now invoke this across your bouncer cluster like so:

Pausing traffic

ansible-playbook -i ansible.inventory ops.yml -e pgbouncer_command=pause -e pgbouncer_command_db=db_name

Resuming traffic

ansible-playbook -i ansible.inventory ops.yml -e pgbouncer_command=resume -e pgbouncer_command_db=db_name

License

This playbook is distributed under the Apache 2.0 license.

ansible-pgbouncer's People

Contributors

mjallday avatar moemen avatar

Watchers

 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.