Skip to content

Commit 2b92f56

Browse files
committed
Documentation: update
1 parent b07a250 commit 2b92f56

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

Documentation.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Current version - 2.2.1
7676
* [Partial Restore Options](#partial-restore-options)
7777
* [Replica Options](#replica-options)
7878

79-
7. [HOWTO](#howto)
79+
7. [Howto](#howto)
8080
* [Minimal setup](#minimal-setup)
8181
8. [Authors](#authors)
8282
9. [Credits](#credits)
@@ -1691,24 +1691,24 @@ You can use these options together with [backup](#backup) and [checkdb](#checkdb
16911691
All [libpq environment variables](https://www.postgresql.org/docs/current/libpq-envars.html) are supported.
16921692

16931693
-d dbname
1694-
--dbname=dbname
1694+
--pgdatabase=dbname
16951695
PGDATABASE
16961696
Specifies the name of the database to connect to. The connection is used only for managing backup process, so you can connect to any existing database. If this option is not provided on the command line, PGDATABASE environment variable, or the pg_probackup.conf configuration file, pg_probackup tries to take this value from the PGUSER environment variable, or from the current user name if PGUSER variable is not set.
16971697

16981698
-h host
1699-
--host=host
1699+
--pghost=host
17001700
PGHOST
17011701
Default: local socket
17021702
Specifies the host name of the system on which the server is running. If the value begins with a slash, it is used as a directory for the Unix domain socket.
17031703

17041704
-p port
1705-
--port=port
1705+
--pgport=port
17061706
PGPORT
17071707
Default: 5432
17081708
Specifies the TCP port or the local Unix domain socket file extension on which the server is listening for connections.
17091709

17101710
-U username
1711-
--username=username
1711+
--pguser=username
17121712
PGUSER
17131713
User name to connect as.
17141714

@@ -1839,31 +1839,37 @@ All examples below assume the remote mode of operations via `ssh`. If you are pl
18391839
Examples are based on Ubuntu 18.04, PostgreSQL 11 and pg_probackup 2.2.0.
18401840

18411841
backup_host - host with backup catalog.
1842+
18421843
backupman - user on `backup_host` running all pg_probackup operations.
1844+
18431845
/mnt/backups - directory on `backup_host` where backup catalog is stored.
18441846

1845-
postgres-host - host with PostgreSQL cluster.
1847+
postgres_host - host with PostgreSQL cluster.
1848+
18461849
postgres - user on `postgres_host` which run PostgreSQL cluster.
1850+
18471851
/var/lib/postgresql/11/main - directory on `postgres_host` where PGDATA of PostgreSQL cluster is located.
1848-
backup_db - database used for connection to PostgreSQL cluster.
1852+
1853+
backupdb - database used for connection to PostgreSQL cluster.
18491854

18501855
### Minimal Setup
18511856

18521857
This setup is relying on autonomous FULL and DELTA backups.
18531858

1854-
1. Setup passwordless SSH connection from `backup_host` to `postgres_host`:
1859+
#### Setup passwordless SSH connection from `backup_host` to `postgres_host`
18551860
```
18561861
[backupman@backup_host] ssh-copy-id postgres@postgres_host
18571862
```
18581863

1859-
2. Setup PostgreSQL cluster.
1860-
2.1. It is recommended from security purposes to use separate database for backup operations.
1864+
#### Setup PostgreSQL cluster
1865+
1866+
It is recommended from security purposes to use separate database for backup operations.
18611867
```
18621868
postgres=#
18631869
CREATE DATABASE backupdb;
18641870
```
18651871

1866-
2.2. Connect to `backupdb` database, create role `probackup` and grant to it the following permissions:
1872+
Connect to `backupdb` database, create role `probackup` and grant to it the following permissions:
18671873
```
18681874
backupdb=#
18691875
BEGIN;
@@ -1882,19 +1888,19 @@ GRANT EXECUTE ON FUNCTION pg_catalog.txid_snapshot_xmax(txid_snapshot) TO probac
18821888
COMMIT;
18831889
```
18841890

1885-
3. Init the backup catalog:
1891+
#### Init the backup catalog
18861892
```
18871893
[backupman@backup_host]$ pg_probackup-11 init -B /mnt/backups
18881894
INFO: Backup catalog '/mnt/backups' successfully inited
18891895
```
18901896

1891-
4. Add instance 'pg-11' to backup catalog:
1897+
#### Add instance 'pg-11' to backup catalog
18921898
```
18931899
[backupman@backup_host]$ pg_probackup-11 add-instance -B /mnt/backups --instance 'pg-11' --remote-host=postgres_host --remote-user=postgres -D /var/lib/postgresql/11/main
18941900
INFO: Instance 'node' successfully inited
18951901
```
18961902

1897-
5. Take FULL backup:
1903+
#### Take FULL backup
18981904
```
18991905
[backupman@backup_host] pg_probackup-11 backup -B /mnt/backups --instance 'pg-11' -b FULL --stream --remote-host=postgres_host --remote-user=postgres -U probackup -d backupdb
19001906
INFO: Backup start, pg_probackup version: 2.2.0, instance: node, backup ID: PZ7YK2, backup mode: FULL, wal mode: STREAM, remote: true, compress-algorithm: none, compress-level: 1
@@ -1908,7 +1914,7 @@ INFO: Backup PZ7YK2 resident size: 196MB
19081914
INFO: Backup PZ7YK2 completed
19091915
```
19101916

1911-
6. Lets take a look at the backup catalog:
1917+
#### Lets take a look at the backup catalog
19121918
```
19131919
[backupman@backup_host] pg_probackup-11 backup -B /mnt/backups --instance 'pg-11'
19141920
@@ -1917,10 +1923,9 @@ BACKUP INSTANCE 'pg-11'
19171923
Instance Version ID Recovery Time Mode WAL Mode TLI Time Data WAL Zratio Start LSN Stop LSN Status
19181924
==================================================================================================================================
19191925
node 11 PZ7YK2 2019-10-11 19:45:45+03 FULL STREAM 1/0 11s 180MB 16MB 1.00 0/3C000028 0/3C000198 OK
1920-
19211926
```
19221927

1923-
7. Take incremental backup in DELTA mode:
1928+
#### Take incremental backup in DELTA mode
19241929
```
19251930
[backupman@backup_host] pg_probackup-11 backup -B /mnt/backups --instance 'pg-11' -b delta --stream --remote-host=postgres_host --remote-user=postgres -U probackup -d backupdb
19261931
INFO: Backup start, pg_probackup version: 2.2.0, instance: node, backup ID: PZ7YMP, backup mode: DELTA, wal mode: STREAM, remote: true, compress-algorithm: none, compress-level: 1
@@ -1935,12 +1940,12 @@ INFO: Backup PZ7YMP resident size: 32MB
19351940
INFO: Backup PZ7YMP completed
19361941
```
19371942

1938-
8. Lets hide some parameters into config, so cmdline can looks less crodwy:
1943+
#### Lets hide some parameters into config, so cmdline can be less crodwy
19391944
```
19401945
[backupman@backup_host] pg_probackup-11 set-config -B /mnt/backups --instance 'pg-11' --remote-host=postgres_host --remote-user=postgres -U probackup -d backupdb
19411946
```
19421947

1943-
9. Take another incremental backup in DELTA mode, omitting the `--remote-host`, `--remote-user`, `-U` and `-d` options:
1948+
#### Take another incremental backup in DELTA mode, omitting some of the previous parameters:
19441949
```
19451950
[backupman@backup_host] pg_probackup-11 backup -B /mnt/backups --instance 'pg-11' -b delta --stream
19461951
INFO: Backup start, pg_probackup version: 2.2.0, instance: node, backup ID: PZ7YR5, backup mode: DELTA, wal mode: STREAM, remote: true, compress-algorithm: none, compress-level: 1
@@ -1955,7 +1960,7 @@ INFO: Backup PZ7YR5 resident size: 32MB
19551960
INFO: Backup PZ7YR5 completed
19561961
```
19571962

1958-
10. Lets take a look at instance config:
1963+
#### Lets take a look at instance config
19591964
```
19601965
[backupman@backup_host] pg_probackup-11 show-config -B /mnt/backups --instance 'pg-11'
19611966
@@ -1992,15 +1997,15 @@ remote-host = postgres_host
19921997
Note, that we are getting default values for other options, that were not overwritten by set-config command.
19931998

19941999

1995-
10. Lets take a look at the backup catalog:
2000+
#### Lets take a look at the backup catalog
19962001
```
19972002
[backupman@backup_host] pg_probackup-11 backup -B /mnt/backups --instance 'pg-11'
19982003
19992004
====================================================================================================================================
2000-
Instance Version ID Recovery Time Mode WAL Mode TLI Time Data WAL Zratio Start LSN Stop LSN Status
2005+
Instance Version ID Recovery Time Mode WAL Mode TLI Time Data WAL Zratio Start LSN Stop LSN Status
20012006
====================================================================================================================================
2002-
node 11 PZ7YR5 2019-10-11 19:49:56+03 DELTA STREAM 1/1 10s 112kB 32MB 1.00 0/41000028 0/41000160 OK
2003-
node 11 PZ7YMP 2019-10-11 19:47:16+03 DELTA STREAM 1/1 10s 376kB 32MB 1.00 0/3E000028 0/3F0000B8 OK
2007+
node 11 PZ7YR5 2019-10-11 19:49:56+03 DELTA STREAM 1/1 10s 112kB 32MB 1.00 0/41000028 0/41000160 OK
2008+
node 11 PZ7YMP 2019-10-11 19:47:16+03 DELTA STREAM 1/1 10s 376kB 32MB 1.00 0/3E000028 0/3F0000B8 OK
20042009
node 11 PZ7YK2 2019-10-11 19:45:45+03 FULL STREAM 1/0 11s 180MB 16MB 1.00 0/3C000028 0/3C000198 OK
20052010
```
20062011

0 commit comments

Comments
 (0)