zoukankan      html  css  js  c++  java
  • postgresql 高可用 repmgr 的使用之七 /etc/repmgr.conf

    /etc/repmgr.conf

    # more /etc/repmgr.conf
    
    ##############################################
    # node information
    node_id=1
    node_name=node1
    conninfo='host=192.168.56.101 user=repmgr dbname=repmgr connect_timeout=2'
    data_directory='/var/lib/postgresql/9.6/main'
    use_replication_slots=true
    pg_bindir='/usr/lib/postgresql/9.6/bin'
    pg_ctl_options='-l /var/log/postgres/startup.log'
    rsync_options=--exclude=postgresql.local.conf --archive
    #use_primary_conninfo_password=true
    #passfile=''
    location='location01'
    ##############################################
    # service_*_command
    service_start_command   = 'sudo pg_ctlcluster 9.6 main start'
    service_stop_command    = 'sudo pg_ctlcluster 9.6 main stop'
    service_restart_command = 'sudo pg_ctlcluster 9.6 main restart'
    service_reload_command  = 'sudo pg_ctlcluster 9.6 main reload' 
    service_promote_command = 'sudo pg_ctlcluster 9.6 main promote'
    ##############################################
    # log info
    log_level=INFO
    log_status_interval=10
    log_file=/var/log/postgresql/repmgrd.log
    ##############################################
    # monitoring
    monitoring_history=yes
    monitor_interval_secs=2
    reconnect_attempts=10
    reconnect_interval=5
    async_query_timeout=600
    ##############################################
    # failover
    failover=automatic
    promote_command='/usr/bin/repmgr standby promote -f /etc/repmgr.conf --log-to-file'
    follow_command='/usr/bin/repmgr standby follow -f /etc/repmgr.conf --log-to-file --upstream-node-id=%n'
    
    

    /etc/logrotate.d/repmgrd

    /var/log/repmgr/repmgrd.log {
            missingok
            compress
            rotate 52
            maxsize 100M
            weekly
            create 0600 postgres postgres
            postrotate
                /usr/bin/killall -HUP repmgrd
            endscript
        }
    

    参考:
    https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample
    https://repmgr.org/docs/4.1/repmgrd-log-rotation.html

  • 相关阅读:
    LINQ Provider表达式树6
    asp.net Forms 验证No.3
    三种用户验证No.1 asp.net Forms
    LinQ表达式目录2
    将ASP.NET MVC 2.0 部署在IIS6和IIS7上
    LINQ Provider 表达式树 5
    asp.net Forms验证No.2
    LINQ表达式树4
    LINQ表达式树3
    绝对精华win8如何使用,玩转win8看完绝不后悔
  • 原文地址:https://www.cnblogs.com/ctypyb2002/p/9792866.html
Copyright © 2011-2022 走看看