https://github.com/ghostbuster91/postgres-cluster-playground
https://github.com/ghostbuster91/postgres-cluster-playground
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ghostbuster91/postgres-cluster-playground
- Owner: ghostbuster91
- Created: 2020-08-13T10:08:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T10:35:27.000Z (about 5 years ago)
- Last Synced: 2025-06-30T10:53:53.334Z (4 months ago)
- Language: Shell
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postgres-cluster-playground
1. start master node
- `docker-compose up -d master-db`
2. create bootstrapping backup for slave-1
- `docker-compose up backup`
3. create bootstrapping backup for slave-2
- `docker-compose up backup2`
4. start slave nodes
- `docker-compose up -d slave-db`
- `docker-compose up -d slave-db2`
5. stop master node
- `docker-compose stop master-db`
6. uncomment synchronous_standby_names in master-config (and change it if you want to)
7. bring back master node
- `docker-compose start master-db`
8. verify that the replication works
- login into the master node
1. `docker-compose exec master-db psql -U postgres`
- check replication stats
1. `select * from pg_stat_replication`
- create some table and fill it with data:
1. `create table example_data(content text not null);`
2. `insert into example_data(content) values('first entry');`
- login into slave-db and verify that the data was replicated
1. `docker-compose exec slave-db psql -U postgres`
2. `select * from example_data;`