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

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...