微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PITRTools



pitrtools is a Python + Postgresql application that assists in the provisioning of Hot Standby,Warm Standby,Cold Standby,Streaming Replication clusters and multiple standbys (slaves). It supports all Postgresql versions from 8.2+ including 9.2.

Requirements:

Rsync

Python >= 2.6

SSH

Postgresql 8.2+

#rpm-qa|greprsync
rsync-3.0.6-9.el6_4.1.x86_64
#python-V
Python2.6.6
$pg_config--version
Postgresql9.3.4

编译安装:

pg_standby

pg_archivecleanup

[root@masterdb~]#mkdir/opt/pg93/archive
[root@masterdb~]#chownpostgres:postgres/opt/pg93/archive/


$cd/opt/pitrtools-1.3/etc/
$cpcmd_archiver.ini.samplecmd_archiver.ini
$cpcmd_standby.ini.samplecmd_standby.ini

cmd_standby

Thecmd_standbyscriptisautilitythatallowseasymanagementofalltypesof
standbyPostgresqlservers,fromcoldtowarmandstreamingrepliaction.

Itcurrentlyhasthefollowingcapabilities:

*Easilytakeabasebackup,includingtablespaces
*Restorearchives
*Automaticallypurgeoldarchives(ifPostgresql>8.3)
*Alertbasedonfailures
*StopandstartPostgresqlstandby
*Failovertothelatestrestorepointandpoint-in-timerecovery

Usage:

cmd_standby[options]arg1arg2

Options:
-h,--helpshowthishelpmessageandexit
-Astart|stop,--action=start|stop
StartorStopPostgresql
-B,--basebackupStart/Stopabasebackup
-CFILE,--config=FILE
thenameofthestandbyconfigfile
-FVALUE,--failover=VALUE
Valueisa3digitnumber999

-I,--dbinitUsebefore-B
-P,--pingIsmymasteralive?
-RTIMESTAMP,--recovertotime=TIMESTAMP
Ifyouneedtorestoretoaspecificpointintime
-S,--standbyEnterstandbymode

cmd_archiver

cmd_archiverscriptisusedinconjunctionwithPostgresql'snative
archivemodefunctionalitytoshipwALsegmentstoconfiguredstandby
servertoreplaythem.

*Automaticallyshiplogfilestoconfiguredstandbyserver
*Enable/disablearchivingwithouttheneedtorestartPostgresql
*Alertbasedonfailures


Usage:

cmd_archiver[options]arg1arg2

Options:
-h,--helpShowthishelpmessageandexit
-FFILE,--file=FILEArchivefile
-CFILE,--config=FILE
Thenameofthearchiverconfigfile
-f,--flushFlushallremainingarchivestoslave
-I,--initinitializemasterenvironment

原文地址:https://www.jb51.cc/postgresql/195613.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐