ttl: &ttl 30
loop_wait: &loop_wait 10
scope: &scope excape2
#namespace: /service/
name: postgresql0

restapi:
  listen: 0.0.0.0:8008
  connect_address: 127.0.0.1:8008
zookeeper:
  scope: *scope
  session_timeout: *ttl
  reconnect_timeout: *loop_wait
  hosts:
    - localhost:2181

bootstrap:
  # this section will be written into Etcd:/<namespace>/<scope>/config after initializing new cluster
  # and all other cluster members will use it as a `global configuration`
  dcs:
    ttl: 30
    loop_wait: 10
    retry_timeout: 10
    maximum_lag_on_failover: 1048576
    postgresql:
      use_pg_rewind: true
      use_slots: true
      parameters:
        archive_mode: "off"
        wal_level: hot_standby
        max_wal_senders: 10
        wal_keep_segments: 100
        archive_timeout: 1800s
        max_replication_slots: 10
        hot_standby: "on"
        wal_log_hints: "on"
        unix_socket_directories: '/tmp'
        max_connections: ${pg_max_connections}
        shared_buffers: ${pg_shared_buffers}
        autovacuum_analyze_scale_factor: 0.05
        autovacuum_vacuum_scale_factor: 0.10
        log_autovacuum_min_duration: 0
        autovacuum_naptime: 15s
        autovacuum_max_workers: 6
      recovery_conf:
        restore_command: cp /var/lib/postgresql/wal_archive/%f %p

  # some desired options for 'initdb'
  initdb:  # Note: It needs to be a list (some options need values, others are switches)
  - encoding: UTF8
  - data-checksums

  pg_hba:  # Add following lines to pg_hba.conf after running 'initdb'
  - host postgres all 127.0.0.1/32 trust
  - host all all 0.0.0.0/0 md5
  - host replication all 0.0.0.0/0 trust
#  - hostssl all all 0.0.0.0/0 md5

  # Some additional users users which needs to be created after initializing new cluster
  users:
    admin:
      password: admin
      options:
        - createrole
        - createdb

postgresql:
  listen: 0.0.0.0:5432
  connect_address: localhost:5432
  data_dir: /var/lib/postgresql/data/postgresql0
  maximum_lag_on_failover: 104857600 # 1 megabyte i
  pgpass: /tmp/pgpass211
  authentication:
    replication:
      username: replicator
      password: rep-pass
      network:  0.0.0.0/0
    superuser:
      username: postgres
      password: abcded
  parameters:
    unix_socket_directories: '.'
  create_replica_method:
   - basebackup  
tags:
    nofailover: false
    noloadbalance: false
    clonefrom: false

