zoukankan      html  css  js  c++  java
  • PostgreSQL的 synchronous_standby_names 参数学习

    磨砺技术珠矶,践行数据之道,追求卓越价值
    回到上一级页面: PostgreSQL集群方案相关索引页     回到顶级页面:PostgreSQL索引页
    [作者 高健@博客园  luckyjackgao@gmail.com]
     

    客户的streaming replication的参数是这样的:synchronous_standby_names=‘’

    官方文档是这样说的:

    synchronous_standby_names (string)
    Specifies a comma-separated list of standby names that can support synchronous replication, as described in Section 25.2.7. At any one time there will be at most one active synchronous standby; transactions waiting for commit will be allowed to proceed after this standby server confirms receipt of their data. The synchronous standby will be the first standby named in this list that is both currently connected and streaming data in real-time (as shown by a state of streaming in the pg_stat_replication view). Other standby servers appearing later in this list represent potential synchronous standbys. If the current synchronous standby disconnects for whatever reason, it will be replaced immediately with the next-highest-priority standby. Specifying more than one standby name can allow very high availability.
    
    The name of a standby server for this purpose is the application_name setting of the standby, as set in the primary_conninfo of the standby's walreceiver. There is no mechanism to enforce uniqueness. In case of duplicates one of the matching standbys will be chosen to be the synchronous standby, though exactly which one is indeterminate. The special entry * matches any application_name, including the default application name of walreceiver.
    
    If no synchronous standby names are specified here, then synchronous replication is not enabled and transaction commits will not wait for replication. This is the default configuration. Even when synchronous replication is enabled, individual transactions can be configured not to wait for replication by setting the synchronous_commit parameter to local or off.
    
    This parameter can only be set in the postgresql.conf file or on the server command line.

    这里,我最关注的是缺省形态,就是此值为空的情况,此时在master和slave之间,是非同步方式。这时master的运行比较高效,不必等待slave复制完毕才进行下一步动作。

     

    [作者 高健@博客园  luckyjackgao@gmail.com]
    回到上一级页面: PostgreSQL集群方案相关索引页     回到顶级页面:PostgreSQL索引页
    磨砺技术珠矶,践行数据之道,追求卓越价值 
     

  • 相关阅读:
    Kafka系列之-Kafka入门
    2018个人年终总结
    javascript 模块化学习:Class打包出来无法实例化问题
    [SqlServer] Error: 15023
    [Auto Testing] 工具准备:Selenium 与 ChromeDriver
    [Python] 模拟登录网站(。。为了之后操作数据。。)
    [Angular 6] 初学angular,环境全部最新,[ ng serve ] 不能启动,卡在 95% 不动 => 解决方案
    [nuget]VS中包管理器打开后找不到其它工程的问题
    当需要给<span>标签设宽度
    关于近期打算
  • 原文地址:https://www.cnblogs.com/gaojian/p/3348253.html
Copyright © 2011-2022 走看看