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 | grep rsync
rsync-3.0.6-9.el6_4.1.x86_64
# python -V
Python 2.6.6
$ pg_config --version
PostgreSQL 9.3.4

 

编译安装:

pg_standby

pg_archivecleanup

 

 

[root@masterdb ~]# mkdir /opt/pg93/archive
[root@masterdb ~]# chown postgres:postgres /opt/pg93/archive/
 
 
$ cd /opt/pitrtools-1.3/etc/
$ cp cmd_archiver.ini.sample cmd_archiver.ini
$ cp cmd_standby.ini.sample cmd_standby.ini

 

cmd_standby

 The cmd_standby script is a utility that allows easy management of all types of
 standby PostgreSQL servers, from cold to warm and streaming repliaction.
 
 It currently has the following capabilities:
 
 * Easily take a base backup, including table spaces
 * Restore archives
 * Automatically purge old archives (if PostgreSQL >8.3)
 * Alert based on failures
 * Stop and start PostgreSQL standby
 * Failover to the latest restore point and point-in-time recovery
 
Usage:
 
 cmd_standby [options] arg1 arg2
 
 Options:
   -h, --help           show this help message and exit
   -A start|stop, --action=start|stop
                        Start or Stop PostgreSQL
   -B, --basebackup     Start/Stop a base backup
   -C FILE, --config=FILE
                        the name of the standby config file
   -F VALUE, --failover=VALUE
                        Value is a 3 digit number 999
 
   -I, --dbinit         Use before -B
   -P, --ping           Is my master alive?
   -R TIMESTAMP, --recovertotime=TIMESTAMP
                        If you need to restore to a specific point in time
   -S, --standby        Enter standby mode

 

 

cmd_archiver

cmd_archiver script is used in conjunction with PostgreSQL's native
 archive mode functionality to ship WAL segments to configured standby
 server to replay them.
 
 * Automatically ship log files to configured standby server
 * Enable/disable archiving without the need to restart PostgreSQL
 * Alert based on failures
 
 
Usage:
 
 cmd_archiver [options] arg1 arg2
 
 Options:
   -h, --help              Show this help message and exit
   -F FILE, --file=FILE    Archive file
   -C FILE, --config=FILE
                           The name of the archiver config file
   -f, --flush             Flush all remaining archives to slave
   -I, --init              Initialize master environment

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值