postgresql recovery.conf改变需要重启吗

之前在研究pgpoll时,发现trigger_file参数指定的文件存在后,会自动将standby节点提升为可写节点。不需要手动执行pg_ctl promote,但是这个时间一般有延迟,因为进程会定期检查复制过程。

今天发现primary_conninfo信息改变,复制过程不会变化,需要重启standby节点。

............................................................................................................................

-bash-4.1$ cat recovery.conf.sample |more# -------------------------------
# PostgreSQL recovery config file
# -------------------------------
#
# Edit this file to provide the parameters that PostgreSQL needs to
# perform an archive recovery of a database, or to act as a replication
# standby.
#
# If "recovery.conf" is present in the PostgreSQL data directory, it is
# read on postmaster startup.  After successful recovery, it is renamed
# to "recovery.done" to ensure that we do not accidentally re-enter
# archive recovery or standby mode.
#
# This file consists of lines of the form:
#
#   name = value
#
# Comments are introduced with ‘#‘.
#
# The complete list of option names and allowed values can be found
# in the PostgreSQL documentation.
#
#---------------------------------------------------------------------------
# ARCHIVE RECOVERY PARAMETERS
#---------------------------------------------------------------------------
#
# restore_command
#
# specifies the shell command that is executed to copy log files
# back from archival storage.  The command string may contain %f,
# which is replaced by the name of the desired log file, and %p,
# which is replaced by the absolute path to copy the log file to.
#
# This parameter is *required* for an archive recovery, but optional
# for streaming replication.
#
# It is important that the command return nonzero exit status on failure.
# The command *will* be asked for log files that are not present in the
# archive; it must return nonzero when so asked.
#
# NOTE that the basename of %p will be different from %f; do not
# expect them to be interchangeable.

#restore_command = ‘‘ # e.g. ‘cp /mnt/server/archivedir/%f %p‘
#
#
# archive_cleanup_command
#
# specifies an optional shell command to execute at every restartpoint.
# This can be useful for cleaning up the archive of a standby server.
#
#archive_cleanup_command = ‘‘
#
# recovery_end_command
#
# specifies an optional shell command to execute at completion of recovery.
# This can be useful for cleaning up after the restore_command.
#
#recovery_end_command = ‘‘
#
#---------------------------------------------------------------------------
# RECOVERY TARGET PARAMETERS
#---------------------------------------------------------------------------
#
# By default, recovery will rollforward to the end of the WAL log.
# If you want to stop rollforward at a specific point, you
# must set a recovery target.
#
# You may set a recovery target either by transactionId, by name,
# or by timestamp. Recovery may either include or exclude the
# transaction(s) with the recovery target value (ie, stop either
# just after or just before the given target, respectively).
#
#
#recovery_target_name = ‘‘ # e.g. ‘daily backup 2011-01-26‘
#
#recovery_target_time = ‘‘ # e.g. ‘2004-07-14 22:39:00 EST‘
#
#recovery_target_xid = ‘‘
#
#recovery_target_inclusive = true
#
#
# Alternatively, you can request stopping as soon as a consistent state
# is reached, by uncommenting this option.

#recovery_target = ‘immediate‘
#
#
# If you want to recover into a timeline other than the "main line" shown in
# pg_control, specify the timeline number here, or write ‘latest‘ to get
# the latest branch for which there‘s a history file.
#
#recovery_target_timeline = ‘latest‘
#
#
# If recovery_target_action = ‘pause‘, recovery will pause when the
# recovery target is reached. The pause state will continue until
# pg_xlog_replay_resume() is called. This setting has no effect if
# no recovery target is set. If hot_standby is not enabled then the
# server will shutdown instead, though you may request this in
# any case by specifying ‘shutdown‘.
#
#recovery_target_action = ‘pause‘
#
#---------------------------------------------------------------------------
# STANDBY SERVER PARAMETERS
#---------------------------------------------------------------------------
#
# standby_mode
#
# When standby_mode is enabled, the PostgreSQL server will work as a
# standby. It will continuously wait for the additional XLOG records, using
# restore_command and/or primary_conninfo.
#
#standby_mode = off
#
# primary_conninfo
#
# If set, the PostgreSQL server will try to connect to the primary using this
# connection string and receive XLOG records continuously.
#
#primary_conninfo = ‘‘ # e.g. ‘host=localhost port=5432‘
#
# If set, the PostgreSQL server will use the specified replication slot when
# connecting to the primary via streaming replication to control resource
# removal on the upstream node. This setting has no effect if primary_conninfo
# is not set.
#

#primary_slot_name = ‘‘
#
# By default, a standby server keeps restoring XLOG records from the
# primary indefinitely. If you want to stop the standby mode, finish recovery
# and open the system in read/write mode, specify a path to a trigger file.
# The server will poll the trigger file path periodically and start as a
# primary server when it‘s found.
#
#trigger_file = ‘‘
#
# By default, a standby server restores XLOG records from the primary as
# soon as possible. If you want to explicitly delay the replay of committed
# transactions from the master, specify a minimum apply delay. For example,
# if you set this parameter to 5min, the standby will replay each transaction
# commit only when the system time on the standby is at least five minutes
# past the commit time reported by the master.
#
#recovery_min_apply_delay = 0
#
#---------------------------------------------------------------------------
# HOT STANDBY PARAMETERS
#---------------------------------------------------------------------------
#
# Hot Standby related parameters are listed in postgresql.conf
#
#---------------------------------------------------------------------------

时间: 2024-10-13 15:58:21

postgresql recovery.conf改变需要重启吗的相关文章

PostgreSQL pg_hba.conf 文件简析

作者:高张远瞩(HiLoveS) 博客:http://www.cnblogs.com/hiloves/ 转载请保留该信息 最近试用PostgreSQL 9.04,将pg_hba.conf配置的一些心得分享.pg_hba.conf是客户端认证配置文件,定义如何认证客户端. 下面是常用的pg_hba.conf配置: 1 2 3 4 5 6 7 8 9 10 # TYPE  DATABASE  USER  CIDR-ADDRESS  METHOD # "local" is for Unix

[转]resolv.conf 配置信息重启后丢失解决方法

我要配置DNS,修改/etc/resolv.conf,修改后重启服务 service network restart ,修改/etc/resolv.conf的信息丢失,请大家看看. 修改前的配置# No nameservers found; try putting DNS servers into your# ifcfg files in /etc/sysconfig/network-scripts like so:## DNS1=xxx.xxx.xxx.xxx# DNS2=xxx.xxx.xx

linux 在/etc/resolv.conf配置dns,重启网卡之后消失问题

今天打开虚拟机启动网卡ping百度ping不通显示ping: unknown host baidu.com,肯定是dns问题. 打开resolv.conf发现上次配好的dns已经消失, 我又重新配置了一些nameserver重启网卡之后继续ping百度还是出现同样的错误.所以我再次查看resolv.conf发现nameserver又消失了. 在/etc/sysconfig/network-scrips/ifcfg-eth0里面配置DNS1和DNS2重启网卡之后发现这次dns不会消失. 后来bai

postgresql pg_hba.conf

pg_hba.conf是客户端认证配置文件 METHOD指定如何处理客户端的认证.常用的有ident,md5,password,trust,reject. PostgreSQL默认只监听本地端口,用netstat -tuln只会看到“tcp 127.0.0.1:5432 LISTEN”. 修改postgresql.conf中的listen_address=*,监听所有端口,这样远程才能通过TCP/IP登录数据库,用 netstat -tuln会看到“tcp 0.0.0.0:5432 LISTEN

搭建 CentOS 6 服务器(8) - MySQL、PostgreSQL

(一)MySQL (1)安装 Shell代码   # yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm # yum info mysql-community-server # yum -y install mysql-community-server # vi /etc/my.cnf character-set-server=utf8 # /etc/init.d/mysqld rest

Pgsql 主从复制

系统版本:Ubuntu12.04数据库版本:postgresql-9.1.3 下载地址:http://ftp.postgresql.org/pub/source/v9.1.3/postgresql-9.1.3.tar.gz Master :192.168.1.10 Slave : 192.168.1.108 Master PostgreSQL安装: sudo apt-get  install lib64readline-gplv2-devlib64readline6-dev libreadlin

pg_basebackup备份恢复参考

创建基础备份:pg_basebackup -Ft -Pv -Xf -z -Z5 -p 5432 -D /pgdata/10/backup/ 1.移除故障的数据目录或者新建数据目录:2.创建数据目录并且解压使用pg_basebackup创建的备份:mkdir -p /pgdata/10/data1chmod 0700 /pgdata/10/data1tar xvzf base.tar.gz -C /pgdata/10/data1/ 3.创建recovery.conf文件进行配置:cp /opt/p

PostgreSQL+pgpooll+Keepalived双机HA方案

(注:本文档中的所有操作在没有说明的情况下都应该使用postgres用户进行操作,postgres用户没有权限的操作方可采用root用户进行操作,可以在本方案中使用postgres用户及该用户的密码替换replcia及replica用户的密码) 方案逻辑图 192.168.100.3的pgpool故障图 192.168.100.4的pgpool故障图 192.168.100.3的Master故障图 一.环境信息 操作系统:CentOS6.6 数据库:PostgreSQL9.3.5 物理机两台:n

PostgreSQL Replication之第四章 设置异步复制(1)

执行完您的第一个即时恢复(PITR,Point-In-Time-Recovery),我们准备在一个真正的复制设置上工作.在本章,您将学会如何设置异步复制和流.我们的目标是确保您可以实现更高的高可用和更高的数据安全性. 在本章,我们将讨论以下主题: • 配置异步复制 • 理解流 • 合并流和归档 • 管理时间线 在本章的最后,您将很容易地在几分钟内设置流复制. 4.1 设置流复制 在前面章节中,我们已经从简单的16MB XLOG文件做了恢复.从逻辑上讲,重放进程一次只能重放16MB.这在您的复制设