refactor: COMMITs added to release locks immediately. UTC usage. Testing env for test branch.
This commit is contained in:
52
QUICKSTART.md
Normal file
52
QUICKSTART.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Quickstart (PostgreSQL Partitioning Test)
|
||||
|
||||
## Start Environment
|
||||
> **Note**: If `docker` commands fail with permission errors, run `newgrp docker` or ensure your user is in the `docker` group (`sudo usermod -aG docker $USER`) and log out/in.
|
||||
|
||||
```bash
|
||||
cd postgresql/docker
|
||||
sudo ./run_test_env.sh --pg 16 --zabbix 7.0
|
||||
# Options: --pg <16|17|18> --zabbix <7.0|7.4>
|
||||
```
|
||||
|
||||
## Verify
|
||||
```bash
|
||||
# Check status
|
||||
docker ps
|
||||
|
||||
# SQL Shell
|
||||
docker exec -it zabbix-db-test psql -U zabbix -d zabbix
|
||||
# Password: zabbix
|
||||
```
|
||||
|
||||
## Reset
|
||||
```bash
|
||||
docker compose down -v
|
||||
```
|
||||
|
||||
## Partitioning
|
||||
See [PARTITIONING.md](../PARTITIONING.md) for details on the implemented declarative partitioning.
|
||||
|
||||
## 🐳 Docker Deployment (Production)
|
||||
The `run_test_env.sh` script automatically populates `init_scripts` for the test environment. To deploy this in your own Docker setup:
|
||||
|
||||
1. **Mount Scripts**: Map the SQL procedures to `/docker-entrypoint-initdb.d/` in your PostgreSQL container.
|
||||
2. **Order Matters**: Scripts execute alphabetically. Ensure they run **after** the Zabbix schema import.
|
||||
|
||||
**Example `docker-compose.yml` snippet:**
|
||||
```yaml
|
||||
services:
|
||||
postgres-server:
|
||||
image: postgres:16
|
||||
volumes:
|
||||
# Mount Zabbix Schema first (e.g., as 01_schema.sql)
|
||||
- ./zabbix_schema.sql:/docker-entrypoint-initdb.d/01_schema.sql
|
||||
|
||||
# Mount Partitioning Procedures (Prefix to run AFTER schema)
|
||||
- ../postgresql/procedures/00_partitions_init.sql:/docker-entrypoint-initdb.d/02_00_part_init.sql
|
||||
- ../postgresql/procedures/01_auditlog_prep.sql:/docker-entrypoint-initdb.d/02_01_audit_prep.sql
|
||||
- ../postgresql/procedures/02_maintenance.sql:/docker-entrypoint-initdb.d/02_02_maintenance.sql
|
||||
- ../postgresql/procedures/03_enable_partitioning.sql:/docker-entrypoint-initdb.d/02_03_enable.sql
|
||||
- ../postgresql/procedures/04_monitoring_view.sql:/docker-entrypoint-initdb.d/02_04_monitor.sql
|
||||
```
|
||||
The container will automatically execute these scripts on first startup, partitioning the tables.
|
||||
Reference in New Issue
Block a user