https://github.com/jobcespedes/pg_cluster
Ansible role for a database cluster using Postgres (11), Pgpool2 (4.0) and Debian (10).
https://github.com/jobcespedes/pg_cluster
ansible ansible-role cluster database molecule pgpool2 postgres
Last synced: 9 months ago
JSON representation
Ansible role for a database cluster using Postgres (11), Pgpool2 (4.0) and Debian (10).
- Host: GitHub
- URL: https://github.com/jobcespedes/pg_cluster
- Owner: jobcespedes
- License: mit
- Created: 2020-05-14T16:54:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T21:24:46.000Z (almost 5 years ago)
- Last Synced: 2025-01-09T07:41:00.874Z (11 months ago)
- Topics: ansible, ansible-role, cluster, database, molecule, pgpool2, postgres
- Language: HTML
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Role Name: pg_cluster
=========
[](https://travis-ci.org/jobcespedes/pg_cluster) [](https://www.buymeacoffee.com/jobcespedes)
A database cluster using Postgres (11), Pgpool2 (4.0) and Debian (10).
The cluster has 3 nodes. Each node runs Pgpool2 and Postgres. Pgpool2 and Postgres have two roles each. For Postgres, those roles are: primary and standby. For Pgpool2, those roles are: active and stanby. Pgpool and Postgres roles are independent. However, the first node starts with both, active (pgpool2) and primary(postgres). It has a Floating IP. The rest of nodes have standby role (pgpool and postgres).
```Plaintext
FLOATING IP
+-----------+ WATCHDOG
+--------| PGPOOL2 |--------+
| ------------- nic0 |
| | | |
| | POSTGRES | |
| | master | |
| +-----------+ |
| nic1| |
+-----------+ | +-----------+
| PGPOOL2 | | | PGPOOL2 |
|-----------| | -------------
| | | | |
| POSTGRES | | | POSTGRES |
| standby |-----------------| stanby |
+-----------+ REPLICATION +-----------+
```
Requirements
------------
- Debian 10
- openssh-server
- netaddr
Role Variables
--------------
- See [`defaults/main.yml`](defaults/main.yml).
Dependencies
------------
- Depends on other Ansible roles: false
Example Playbook
----------------
```yaml
- hosts: all
roles:
- jobcespedes.pg_cluster
```
For verifying installation
```yaml
- hosts: all
tasks:
- import_role:
name: jobcespedes.pg_cluster
tasks_from: verify
```
License
-------
MIT
Author Information
------------------
Job Céspedes Ortiz: jobcespedes@gmail.com