daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest May 16th, 2018 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Postgresql
  2. Clean config
  3.  
  4.     cat postgresql.conf.bak | grep -Pv "(^#)|^$" | sed 's/#.*$//g' | sed '/^\s*$/d'
  5.  
  6. Add path to postgres
  7.  
  8.     echo 'pathmunge /usr/pgsql-9.6/bin/' > /etc/profile.d/postgres.sh
  9.     . /etc/profile
  10.  
  11.     Minimal postgres 9.6 config
  12.     max_connections = 100          
  13.     shared_buffers = 128MB         
  14.     dynamic_shared_memory_type = posix 
  15.     log_destination = 'stderr'     
  16.     logging_collector = on         
  17.     log_directory = 'pg_log'       
  18.     log_filename = 'postgresql-%a.log' 
  19.     log_truncate_on_rotation = on      
  20.     log_rotation_age = 1d          
  21.     log_rotation_size = 0          
  22.     log_line_prefix = '< %m > '        
  23.     log_timezone = 'W-SU'
  24.     datestyle = 'iso, mdy'
  25.     timezone = 'W-SU'
  26.     lc_messages = 'en_US.UTF-8'        
  27.     lc_monetary = 'en_US.UTF-8'        
  28.     lc_numeric = 'en_US.UTF-8'         
  29.     lc_time = 'en_US.UTF-8'            
  30.     default_text_search_config = 'pg_catalog.english'
  31.     listen_addresses = '*'
  32.     #replication
  33.     wal_level = hot_standby
  34.     wal_log_hints = on
  35.     max_wal_senders = 8
  36.     wal_keep_segments = 64
  37.     hot_standby = on
  38.  
  39. minimal recovery.conf
  40.  
  41.     standby_mode = 'on'
  42.     primary_conninfo = 'user=postgres host=master port=5432 sslmode=prefer sslcompression=1 krbsrvname=postgres'
  43.  
  44. pg_basebackup
  45.  
  46.     pg_basebackup -P -X stream -R -D data/ -h master
RAW Paste Data
Top