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索引页
    磨砺技术珠矶,践行数据之道,追求卓越价值 
     

  • 相关阅读:
    GC算法 垃圾收集器
    JVM内存结构
    java类的加载机制
    Spring Boot:Web 综合开发
    构建微服务:Spring boot 入门篇
    Spring Boot:Spring Boot 中 Redis 的使用
    Spring Boot:Thymeleaf 使用详解
    Android ActionBar完全解析,使用官方推荐的最佳导航栏(下)
    用ActionBar的ActionProvider的时候报错:cannot be cast to android.view.ActionProvider
    百度图片API
  • 原文地址:https://www.cnblogs.com/gaojian/p/3348253.html
Copyright © 2011-2022 走看看