mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
48 lines
1000 B
Markdown
48 lines
1000 B
Markdown
## Ubuntu 安装
|
|
|
|
### 依赖
|
|
```
|
|
sudo apt-get install postgresql-server-dev-all
|
|
|
|
sudo apt-get install libselinux1-dev libzstd-dev liblz4-dev libpam0g-dev libkrb5-dev libreadline-dev
|
|
sudo apt-get install clang-14
|
|
|
|
```
|
|
|
|
### 编译
|
|
```
|
|
|
|
git clone https://github.com/ossc-db/pg_rman.git
|
|
cd pg_rman
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
|
|
|
## 初始化
|
|
|
|
|
|
```
|
|
|
|
/usr/lib/postgresql/15/bin/pg_rman init \
|
|
-B /data/postgresql/backup \
|
|
-D /var/lib/postgresql/15/main/ \
|
|
-G /etc/postgresql/15/main/postgresql.conf \
|
|
-A /data/postgresql/wal/ \
|
|
-S /var/log/postgresql/
|
|
```
|
|
|
|
|
|
## 全量备份
|
|
|
|
```
|
|
PGPASSWORD=abc@123 /usr/lib/postgresql/15/bin/pg_rman backup -b f -B /data/postgresql/backup -D /var/lib/postgresql/15/main/ -G /etc/postgresql/15/main/postgresql.conf -A /data/postgresql/wal/ -S /var/log/postgresql/ -d coal_master -h localhost -p 5432 -U postgres
|
|
|
|
/usr/lib/postgresql/15/bin/pg_rman validate -B /data/postgresql/backup/
|
|
/usr/lib/postgresql/15/bin/pg_rman show -B /data/postgresql/backup/
|
|
|
|
``` |