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
#
#---------------------------------------------------------------------------
postgresql recovery.conf改变需要重启吗的更多相关文章
- PostgreSQL recovery.conf恢复配置
PostgreSQL recovery.conf恢复配置 这一章描述recovery.conf 文件中可用的设置.它们只应用于恢复期.对于你希望执行的任意后续恢复, 它们必须被重置.一旦恢复已经开始, ...
- postgresql recovery.conf文件内容说明
在配置PG主备流复制.HA时,需要用到recovery.conf文件,这里根据自己的了解做个记录: standby_mode = 'on' #说明自己是备库 primary_conninfo = 'u ...
- recovery.conf文件详解
在恢复过程中,用户可以通过使用recovery.conf文件来指定恢复的各个参数,如下: 归档恢复设置 restore_command:用于获取一个已归档段的XLOG日志文件的命令 archive_c ...
- FATAL: using recovery command file "recovery.conf" is not supported
PostgreSQL12 附录 E. 版本说明 将recovery.conf设置移动到postgresql.conf中. (Masao Fujii, Simon Riggs, Abhijit Meno ...
- PostgreSQL pg_hba.conf 文件简析
作者:高张远瞩(HiLoveS) 博客:http://www.cnblogs.com/hiloves/ 转载请保留该信息 最近试用PostgreSQL 9.04,将pg_hba.conf配置的一些心得 ...
- postgresql pg_hba.conf
pg_hba.conf是客户端认证配置文件 METHOD指定如何处理客户端的认证.常用的有ident,md5,password,trust,reject. PostgreSQL默认只监听本地端口,用n ...
- 利用 Forcing InnoDB Recovery 特性解决 MySQL 重启失败的问题
小明同学在本机上安装了 MySQL 5.7.17 配合项目进行开发,并且已经有了一部分重要数据.某天小明在开发的时候,需要出去一趟就直接把电脑关掉了,没有让 MySQL 正常关闭,重启 MySQL 的 ...
- node配置自动监测文件改变不重启
方法一: nodemon npm install -g nodemon nodemon ./bin/www 或者在npm start命令里把node改为nodemon 方法二:supervisor n ...
- replication_slot and PostgreSQL Replication
主库IP:192.168.230.128 备库IP:192.168.230.129 PostgreSQL版本: 主备机PostgreSQL源码包均位于/opt/soft_bak OS:CentOS5 ...
随机推荐
- C/C++中浮点数输出格式问题
在C语言中,浮点数的输出格式有三种:%g, %f, %e 首先要说的是%e是采用科学计数法来显示. %g与后两者有一个重要的差别,就是设置输出精度的时候,(C中默认浮点输出精度是6),%g认为,包括整 ...
- Python Parameter Passing Note
我刚刚开始学习Python, Python中的参数传递总是让我很困惑.我写了4个简单的Demo,帮助我理解Python的参数传递,希望对大家都能有所帮助. 0: def change(x): x = ...
- rsync+inotify实时同步
!!!在安装前要先确保,rsync daemon服务配置成功,在安装inotify-tools前先确认你的linux内核是否达到了2.6.13,并且在编译时开启CONFIG_INOTIFY选项,也可以 ...
- linux 基础知识总结
1. 查看目录文件命令: 查看以f开头的文件:ll f* 查看/usr/local目录下的文件:ll /usr/local 按最后的修改的时间顺序,列出:ll -t */f* ...
- javascript Date对象 之 时间转字符串
javascript Date对象 --> 时间转字符串: 测试代码: <!DOCTYPE html> <html lang="en"> <he ...
- Python MySQL数据库连接模块
1. MySQLdb只支持在Python 2版本使用MySQLdb是用于Python链接Mysql数据库的接口.a.pip安装 直接使用pip进行安装,在此之前需要安装一些系统依赖包. ● CentO ...
- VRChat简易教程1-开发环境准备(SDK)
原文:https://docs.vrchat.com/docs/setting-up-the-sdk 1 Unity 2017.4.15f1 下载地址https://download.unity3d. ...
- 20145229吴姗珊《网络对抗》WEB基础实践
20145229吴姗珊<网络对抗>WEB基础实践 基础与实践 基础问题 1.什么是表单 表单是可以收集用户的信息和反馈意见,是网站管理者与浏览者之间沟通的桥梁. 一部分是HTML源代码用于 ...
- 配置windows qt开发环境
1.解压缩MinGW-gcc440_1.zip.将解压后的文件夹复制至C盘根目录下.2.安装qt-creator-win-opensource-2.5.2.3.安装qt-win-opensource- ...
- Linux之Shell 脚本加密工具-shc
Much effort, much prosperity. 为什么要加密Shell脚本呢?当然是为了安全! 可能脚本里面涉及到密码之类的就需要进行加密了 一.下载安装shc工具 要保护自己编写的she ...