Hackfut Security File Manager
Current Path:
/opt/td-agent/embedded/share/man/man1
opt
/
td-agent
/
embedded
/
share
/
man
/
man1
/
📁
..
📄
clusterdb.1
(5.77 KB)
📄
createdb.1
(7.26 KB)
📄
createlang.1
(5.3 KB)
📄
createuser.1
(9.42 KB)
📄
dropdb.1
(5.25 KB)
📄
droplang.1
(5.1 KB)
📄
dropuser.1
(5.23 KB)
📄
ecpg.1
(5.04 KB)
📄
erb.1
(3.24 KB)
📄
initdb.1
(10.26 KB)
📄
irb.1
(3.43 KB)
📄
libtool.1
(9.63 KB)
📄
libtoolize.1
(2.53 KB)
📄
lzcat.1
(63.13 KB)
📄
lzma.1
(63.13 KB)
📄
lzmadec.1
(2.77 KB)
📄
lzmainfo.1
(1.22 KB)
📄
makedepend.1
(9.3 KB)
📄
oid2name.1
(8.64 KB)
📄
pg_archivecleanup.1
(5.43 KB)
📄
pg_basebackup.1
(17.68 KB)
📄
pg_config.1
(6.11 KB)
📄
pg_controldata.1
(2.22 KB)
📄
pg_ctl.1
(13.54 KB)
📄
pg_dump.1
(35 KB)
📄
pg_dumpall.1
(13.76 KB)
📄
pg_isready.1
(4.56 KB)
📄
pg_receivexlog.1
(8.9 KB)
📄
pg_recvlogical.1
(8.03 KB)
📄
pg_resetxlog.1
(8.58 KB)
📄
pg_restore.1
(22 KB)
📄
pg_rewind.1
(7.08 KB)
📄
pg_standby.1
(10.33 KB)
📄
pg_test_fsync.1
(2.86 KB)
📄
pg_test_timing.1
(9.74 KB)
📄
pg_upgrade.1
(22.02 KB)
📄
pg_xlogdump.1
(4.58 KB)
📄
pgbench.1
(36.58 KB)
📄
pkg-config.1
(18.73 KB)
📄
postgres.1
(21.49 KB)
📄
postmaster.1
(1.47 KB)
📄
psql.1
(101.06 KB)
📄
reindexdb.1
(6.55 KB)
📄
ri.1
(5.22 KB)
📄
ruby.1
(18.51 KB)
📄
unlzma.1
(63.13 KB)
📄
unxz.1
(63.13 KB)
📄
vacuumdb.1
(8.15 KB)
📄
vacuumlo.1
(4.19 KB)
📄
xml2-config.1
(1.15 KB)
📄
xmlcatalog.1
(8.2 KB)
📄
xmllint.1
(13.15 KB)
📄
xsltproc.1
(8.06 KB)
📄
xz.1
(63.13 KB)
📄
xzcat.1
(63.13 KB)
📄
xzdec.1
(2.77 KB)
Editing: pg_rewind.1
'\" t .\" Title: pg_rewind .\" Author: The PostgreSQL Global Development Group .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> .\" Date: 2018 .\" Manual: PostgreSQL 9.6.9 Documentation .\" Source: PostgreSQL 9.6.9 .\" Language: English .\" .TH "PG_REWIND" "1" "2018" "PostgreSQL 9.6.9" "PostgreSQL 9.6.9 Documentation" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pg_rewind \- synchronize a PostgreSQL data directory with another data directory that was forked from it .SH "SYNOPSIS" .HP \w'\fBpg_rewind\fR\ 'u \fBpg_rewind\fR [\fIoption\fR...] {\fB\-D\ \fR | \fB\-\-target\-pgdata\fR}\fI directory\fR {\fB\-\-source\-pgdata=\fR\fB\fIdirectory\fR\fR | \fB\-\-source\-server=\fR\fB\fIconnstr\fR\fR} .SH "DESCRIPTION" .PP pg_rewind is a tool for synchronizing a PostgreSQL cluster with another copy of the same cluster, after the clusters\*(Aq timelines have diverged\&. A typical scenario is to bring an old master server back online after failover as a standby that follows the new master\&. .PP The result is equivalent to replacing the target data directory with the source one\&. Only changed blocks from relation files are copied; all other files are copied in full, including configuration files\&. The advantage of pg_rewind over taking a new base backup, or tools like rsync, is that pg_rewind does not require reading through unchanged blocks in the cluster\&. This makes it a lot faster when the database is large and only a small fraction of blocks differ between the clusters\&. .PP pg_rewind examines the timeline histories of the source and target clusters to determine the point where they diverged, and expects to find WAL in the target cluster\*(Aqs pg_xlog directory reaching all the way back to the point of divergence\&. The point of divergence can be found either on the target timeline, the source timeline, or their common ancestor\&. In the typical failover scenario where the target cluster was shut down soon after the divergence, this is not a problem, but if the target cluster ran for a long time after the divergence, the old WAL files might no longer be present\&. In that case, they can be manually copied from the WAL archive to the pg_xlog directory, or fetched on startup by configuring recovery\&.conf\&. The use of pg_rewind is not limited to failover, e\&.g\&. a standby server can be promoted, run some write transactions, and then rewinded to become a standby again\&. .PP When the target server is started for the first time after running pg_rewind, it will go into recovery mode and replay all WAL generated in the source server after the point of divergence\&. If some of the WAL was no longer available in the source server when pg_rewind was run, and therefore could not be copied by the pg_rewind session, it must be made available when the target server is started\&. This can be done by creating a recovery\&.conf file in the target data directory with a suitable \fIrestore_command\fR\&. .PP pg_rewind requires that the target server either has the wal_log_hints option enabled in postgresql\&.conf or data checksums enabled when the cluster was initialized with initdb\&. Neither of these are currently on by default\&. full_page_writes must also be set to on, but is enabled by default\&. .SH "OPTIONS" .PP pg_rewind accepts the following command\-line arguments: .PP \fB\-D \fR\fB\fIdirectory\fR\fR .br \fB\-\-target\-pgdata=\fR\fB\fIdirectory\fR\fR .RS 4 This option specifies the target data directory that is synchronized with the source\&. The target server must be shut down cleanly before running pg_rewind .RE .PP \fB\-\-source\-pgdata=\fR\fB\fIdirectory\fR\fR .RS 4 Specifies the file system path to the data directory of the source server to synchronize the target with\&. This option requires the source server to be cleanly shut down\&. .RE .PP \fB\-\-source\-server=\fR\fB\fIconnstr\fR\fR .RS 4 Specifies a libpq connection string to connect to the source PostgreSQL server to synchronize the target with\&. The connection must be a normal (non\-replication) connection with superuser access\&. This option requires the source server to be running and not in recovery mode\&. .RE .PP \fB\-n\fR .br \fB\-\-dry\-run\fR .RS 4 Do everything except actually modifying the target directory\&. .RE .PP \fB\-P\fR .br \fB\-\-progress\fR .RS 4 Enables progress reporting\&. Turning this on will deliver an approximate progress report while copying data from the source cluster\&. .RE .PP \fB\-\-debug\fR .RS 4 Print verbose debugging output that is mostly useful for developers debugging pg_rewind\&. .RE .PP \fB\-V\fR .br \fB\-\-version\fR .RS 4 Display version information, then exit\&. .RE .PP \fB\-?\fR .br \fB\-\-help\fR .RS 4 Show help, then exit\&. .RE .SH "ENVIRONMENT" .PP When \fB\-\-source\-server\fR option is used, pg_rewind also uses the environment variables supported by libpq (see Section 32.14, \(lqEnvironment Variables\(rq, in the documentation)\&. .SH "NOTES" .SS "How it works" .PP The basic idea is to copy all file system\-level changes from the source cluster to the target cluster: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Scan the WAL log of the target cluster, starting from the last checkpoint before the point where the source cluster\*(Aqs timeline history forked off from the target cluster\&. For each WAL record, record each data block that was touched\&. This yields a list of all the data blocks that were changed in the target cluster, after the source cluster forked off\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Copy all those changed blocks from the source cluster to the target cluster, either using direct file system access (\fB\-\-source\-pgdata\fR) or SQL (\fB\-\-source\-server\fR)\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} Copy all other files such as pg_clog and configuration files from the source cluster to the target cluster (everything except the relation files)\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 4.\h'+01'\c .\} .el \{\ .sp -1 .IP " 4." 4.2 .\} Apply the WAL from the source cluster, starting from the checkpoint created at failover\&. (Strictly speaking, pg_rewind doesn\*(Aqt apply the WAL, it just creates a backup label file that makes PostgreSQL start by replaying all WAL from that checkpoint forward\&.) .RE
Upload File
Create Folder