mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-24 23:41:21 +08:00
增加pg_rman文档
This commit is contained in:
48
doc/pgrman.md
Normal file
48
doc/pgrman.md
Normal file
@@ -0,0 +1,48 @@
|
||||
## 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/
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user