Skip to content

Commit

Permalink
Added pgSCV demo laboratory (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikhail Grigorev <[email protected]>
  • Loading branch information
CHERTS and Mikhail Grigorev authored Sep 11, 2024
1 parent c7cd26c commit 73d21d2
Show file tree
Hide file tree
Showing 32 changed files with 26,286 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,19 @@ debug_run.*
# Bin
bin/*
# Test
.test_coverage.*
.test_coverage.*
# Exclude demo-stack data
deploy/demo-lab/pgbench/stop_pgbench_*
deploy/demo-lab/grafana/data/*
deploy/demo-lab/patroni/etc_data1/*
deploy/demo-lab/patroni/etc_data2/*
deploy/demo-lab/patroni/etc_data3/*
deploy/demo-lab/patroni/pg_data1/*
deploy/demo-lab/patroni/pg_data2/*
deploy/demo-lab/patroni/pg_data3/*
deploy/demo-lab/postgres/pg12data/*
deploy/demo-lab/postgres/pg13data/*
deploy/demo-lab/postgres/pg14data/*
deploy/demo-lab/postgres/pg15data/*
deploy/demo-lab/postgres/pg16data/*
deploy/demo-lab/victoriametrics/data/*
26 changes: 26 additions & 0 deletions deploy/demo-lab/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# pgSCV settings
LOG_LEVEL=debug
#PGSCV_CONFIG_FILE=/etc/pgscv.yaml
#PGSCV_LISTEN_ADDRESS="127.0.0.1:9890"
#PGSCV_AUTH_USERNAME=monitoring
#PGSCV_AUTH_PASSWORD=supersecretpassword
#PGSCV_AUTH_KEYFILE=/etc/ssl/private/ssl-cert-snakeoil.key
#PGSCV_AUTH_CERTFILE=/etc/ssl/certs/ssl-cert-snakeoil.pem
#PGSCV_NO_TRACK_MODE=false
#PGSCV_COLLECT_TOP_QUERY=15
#PGSCV_COLLECT_TOP_TABLE=15
#PGSCV_COLLECT_TOP_INDEX=15
#POSTGRES_DSN_db1=postgresql://pgscv:pgscv@host1:5432/pgbench1
#POSTGRES_DSN_db2=postgresql://pgscv:pgscv@host1:5432/pgbench2
#PGSCV_DATABASES="^pgbench.*$"
#PGSCV_DISABLE_COLLECTORS="system,postgres/logs"

# Patroni settings
PATRONI_RESTAPI_USERNAME=admin
PATRONI_RESTAPI_PASSWORD=admin
PATRONI_SUPERUSER_USERNAME=postgres
PATRONI_SUPERUSER_PASSWORD=postgres
PATRONI_REPLICATION_USERNAME=replicator
PATRONI_REPLICATION_PASSWORD=replicate
PATRONI_admin_PASSWORD=admin
PATRONI_admin_OPTIONS=createdb,createrole
73 changes: 73 additions & 0 deletions deploy/demo-lab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# pgSCV demo laboratory

### Requirements

- Docker
- Docker Compose

### List of running containers and ports
- pgscv (listen port: 9890)
- grafana (listen port: 3000)
- vmagent (listen port: 8429)
- victoriametrics (listen port: 8428)
- postgres12 (listen port: 5432)
- postgres13 (listen port: 5433)
- postgres14 (listen port: 5434)
- postgres15 (listen port: 5435)
- postgres16 (listen port: 5436)
- pgbouncer12 (listen port: 6432)
- pgbouncer13 (listen port: 6433)
- pgbouncer14 (listen port: 6434)
- pgbouncer15 (listen port: 6435)
- pgbouncer16 (listen port: 6436)
- etcd1
- etcd2
- etcd3
- patroni1 (listen port: 5437, 8008)
- patroni2 (listen port: 5438, 8009)
- patroni3 (listen port: 5439, 8010)
- haproxy (listen port: 5000, 5001)
- pgbench_12
- pgbench_13
- pgbench_14
- pgbench_15
- pgbench_16
- pgbench_patroni
- pgbench_patroni_s

### Quick start

Run pgSCV demo laboratory:
```bash
docker-compose up -d
```

Start pgbench tests:
```bash
./start_pgbench.sh
```

Open Grafana into Web browser URL: http://127.0.0.1:3000

Login: admin

Password: admin

Open pgSCV dashboards, enjoy and drink coffee ;)

View pgSCV logs:
```bash
docker logs pgscv -f
```

### Stop demo laboratory and cleanup data

Stop pgbench tests:
```bash
./stop_pgbench.sh
```

Stop pgSCV demo laboratory and cleanup demo data:
```bash
./stop_and_cleanup_data.sh
```
Loading

0 comments on commit 73d21d2

Please sign in to comment.