Skip to content

Commit

Permalink
upgrade postgres role to 9.5 (xenial)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingramchen committed Jun 18, 2016
1 parent df01bf2 commit a918a68
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
1 change: 0 additions & 1 deletion kaif-deploy/roles/postgresql/defaults/main.yml
@@ -1,5 +1,4 @@
postgresql: postgresql:
max_connections: '100' max_connections: '100'
shared_buffers: '32MB' shared_buffers: '32MB'
checkpoint_segments: '3'
effective_cache_size: '512MB' effective_cache_size: '512MB'
Expand Up @@ -27,7 +27,7 @@
# Memory units: kB = kilobytes Time units: ms = milliseconds # Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds # MB = megabytes s = seconds
# GB = gigabytes min = minutes # GB = gigabytes min = minutes
# h = hours # TB = terabytes h = hours
# d = days # d = days




Expand All @@ -38,15 +38,15 @@
# The default values of these variables are driven from the -D command-line # The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir. # option or PGDATA environment variable, represented here as ConfigDir.


data_directory = '/var/lib/postgresql/9.3/main' # use data in another directory data_directory = '/var/lib/postgresql/{{postgresql_version}}/main' # use data in another directory
# (change requires restart) # (change requires restart)
hba_file = '/etc/postgresql/9.3/main/pg_hba.conf' # host-based authentication file hba_file = '/etc/postgresql/{{postgresql_version}}/main/pg_hba.conf' # host-based authentication file
# (change requires restart) # (change requires restart)
ident_file = '/etc/postgresql/9.3/main/pg_ident.conf' # ident configuration file ident_file = '/etc/postgresql/{{postgresql_version}}/main/pg_ident.conf' # ident configuration file
# (change requires restart) # (change requires restart)


# If external_pid_file is not explicitly set, no extra PID file is written. # If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/9.3-main.pid' # write an extra PID file external_pid_file = '/var/run/postgresql/{{postgresql_version}}-main.pid' # write an extra PID file
# (change requires restart) # (change requires restart)




Expand Down Expand Up @@ -80,19 +80,20 @@ unix_socket_directories = '/var/run/postgresql' # comma-separated list of direct


#authentication_timeout = 1min # 1s-600s #authentication_timeout = 1min # 1s-600s
ssl = true # (change requires restart) ssl = true # (change requires restart)
#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers #ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
# (change requires restart) # (change requires restart)
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations #ssl_prefer_server_ciphers = on # (change requires restart)
#ssl_ecdh_curve = 'prime256v1' # (change requires restart)
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart)
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart)
#ssl_ca_file = '' # (change requires restart) #ssl_ca_file = '' # (change requires restart)
#ssl_crl_file = '' # (change requires restart) #ssl_crl_file = '' # (change requires restart)
#password_encryption = on #password_encryption = on
#db_user_namespace = off #db_user_namespace = off
#row_security = on


# Kerberos and GSSAPI # GSSAPI using Kerberos
#krb_server_keyfile = '' #krb_server_keyfile = ''
#krb_srvname = 'postgres' # (Kerberos only)
#krb_caseins_users = off #krb_caseins_users = off


# - TCP Keepalives - # - TCP Keepalives -
Expand All @@ -117,6 +118,7 @@ ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires rest
#vagrant vm use 32MB #vagrant vm use 32MB
shared_buffers = {{postgresql.shared_buffers}} # min 128kB shared_buffers = {{postgresql.shared_buffers}} # min 128kB
# (change requires restart) # (change requires restart)
#huge_pages = try # on, off, or try
#temp_buffers = 8MB # min 800kB #temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature #max_prepared_transactions = 0 # zero disables the feature
# (change requires restart) # (change requires restart)
Expand All @@ -128,7 +130,16 @@ shared_buffers = {{postgresql.shared_buffers}} # min 128kB
work_mem = 4MB # min 64kB work_mem = 4MB # min 64kB
#kaif, default 16MB #kaif, default 16MB
maintenance_work_mem = 128MB # min 1MB maintenance_work_mem = 128MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#max_stack_depth = 2MB # min 100kB #max_stack_depth = 2MB # min 100kB
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# use none to disable dynamic shared memory

# - Disk - # - Disk -


#temp_file_limit = -1 # limits per-session temp file space #temp_file_limit = -1 # limits per-session temp file space
Expand Down Expand Up @@ -157,6 +168,7 @@ maintenance_work_mem = 128MB # min 1MB
# - Asynchronous Behavior - # - Asynchronous Behavior -


#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
#max_worker_processes = 8




#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Expand All @@ -165,7 +177,7 @@ maintenance_work_mem = 128MB # min 1MB


# - Settings - # - Settings -


#wal_level = minimal # minimal, archive, or hot_standby #wal_level = minimal # minimal, archive, hot_standby, or logical
# (change requires restart) # (change requires restart)
#fsync = on # turns forced synchronization on or off #fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level; #synchronous_commit = on # synchronization level;
Expand All @@ -178,6 +190,9 @@ maintenance_work_mem = 128MB # min 1MB
# fsync_writethrough # fsync_writethrough
# open_sync # open_sync
#full_page_writes = on # recover from partial page writes #full_page_writes = on # recover from partial page writes
#wal_compression = off # enable compression of full-page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#kaif, default is -1 (64kb?) #kaif, default is -1 (64kb?)
wal_buffers = 16MB # min 32kB, -1 sets based on shared_buffers wal_buffers = 16MB # min 32kB, -1 sets based on shared_buffers
# (change requires restart) # (change requires restart)
Expand All @@ -188,14 +203,15 @@ wal_buffers = 16MB # min 32kB, -1 sets based on shared_buff


# - Checkpoints - # - Checkpoints -


checkpoint_segments = {{postgresql.checkpoint_segments}} # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 5min # range 30s-1h #checkpoint_timeout = 5min # range 30s-1h
#max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
#checkpoint_warning = 30s # 0 disables #checkpoint_warning = 30s # 0 disables


# - Archiving - # - Archiving -


#archive_mode = off # allows archiving to be done #archive_mode = off # enables archiving; off, on, or always
# (change requires restart) # (change requires restart)
#archive_command = '' # command to use to archive a logfile segment #archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive # placeholders: %p = path of file to archive
Expand All @@ -218,6 +234,11 @@ checkpoint_segments = {{postgresql.checkpoint_segments}} # in logfile segments,
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables #wal_sender_timeout = 60s # in milliseconds; 0 disables


#max_replication_slots = 0 # max number of replication slots
# (change requires restart)
#track_commit_timestamp = off # collect timestamp of transaction commit
# (change requires restart)

# - Master Server - # - Master Server -


# These settings are ignored on a standby server. # These settings are ignored on a standby server.
Expand Down Expand Up @@ -246,6 +267,8 @@ checkpoint_segments = {{postgresql.checkpoint_segments}} # in logfile segments,
#wal_receiver_timeout = 60s # time that receiver waits for #wal_receiver_timeout = 60s # time that receiver waits for
# communication from master # communication from master
# in milliseconds; 0 disables # in milliseconds; 0 disables
#wal_retrieve_retry_interval = 5s # time to wait before retrying to
# retrieve WAL after a failed attempt




#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Expand Down Expand Up @@ -274,7 +297,7 @@ checkpoint_segments = {{postgresql.checkpoint_segments}} # in logfile segments,
#cpu_index_tuple_cost = 0.005 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above


#kaif, default is 128MB #kaif, default is 4GB
effective_cache_size = {{postgresql.effective_cache_size}} effective_cache_size = {{postgresql.effective_cache_size}}


# - Genetic Query Optimizer - # - Genetic Query Optimizer -
Expand Down Expand Up @@ -401,7 +424,7 @@ effective_cache_size = {{postgresql.effective_cache_size}}
#log_duration = off #log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages #log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off #log_hostname = off
log_line_prefix = '%t ' # special values: log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values:
# %a = application name # %a = application name
# %u = user name # %u = user name
# %d = database name # %d = database name
Expand All @@ -423,12 +446,20 @@ log_line_prefix = '%t ' # special values:
# e.g. '<%u%%%d> ' # e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout #log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = 'none' # none, ddl, mod, all #log_statement = 'none' # none, ddl, mod, all
#log_replication_commands = off
#log_temp_files = -1 # log temporary files equal or larger #log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes; # than the specified size in kilobytes;
# -1 disables, 0 logs all temp files # -1 disables, 0 logs all temp files
log_timezone = 'ROC' log_timezone = 'ROC'




# - Process Title -

#cluster_name = '' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on


#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# RUNTIME STATISTICS # RUNTIME STATISTICS
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Expand All @@ -440,8 +471,7 @@ log_timezone = 'ROC'
#track_io_timing = off #track_io_timing = off
#track_functions = none # none, pl, all #track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart) #track_activity_query_size = 1024 # (change requires restart)
#update_process_title = on stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp'
#stats_temp_directory = 'pg_stat_tmp'




# - Statistics Monitoring - # - Statistics Monitoring -
Expand Down Expand Up @@ -473,7 +503,7 @@ log_timezone = 'ROC'
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart) # (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age #autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum # before forced vacuum
# (change requires restart) # (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
Expand All @@ -490,7 +520,7 @@ log_timezone = 'ROC'


# - Statement Behavior - # - Statement Behavior -


#search_path = '"$user",public' # schema names #search_path = '"$user", public' # schema names
#default_tablespace = '' # a tablespace name, '' uses the default #default_tablespace = '' # a tablespace name, '' uses the default
#temp_tablespaces = '' # a list of tablespace names, '' uses #temp_tablespaces = '' # a list of tablespace names, '' uses
# only default tablespace # only default tablespace
Expand All @@ -508,6 +538,8 @@ log_timezone = 'ROC'
#bytea_output = 'hex' # hex, escape #bytea_output = 'hex' # hex, escape
#xmlbinary = 'base64' #xmlbinary = 'base64'
#xmloption = 'content' #xmloption = 'content'
#gin_fuzzy_search_limit = 0
#gin_pending_list_limit = 4MB


# - Locale and Formatting - # - Locale and Formatting -


Expand All @@ -517,7 +549,7 @@ timezone = 'ROC'
#timezone_abbreviations = 'Default' # Select the set of available time zone #timezone_abbreviations = 'Default' # Select the set of available time zone
# abbreviations. Currently, there are # abbreviations. Currently, there are
# Default # Default
# Australia # Australia (historical usage)
# India # India
# You can create your own file in # You can create your own file in
# share/timezonesets/. # share/timezonesets/.
Expand All @@ -539,6 +571,7 @@ default_text_search_config = 'pg_catalog.english'


#dynamic_library_path = '$libdir' #dynamic_library_path = '$libdir'
#local_preload_libraries = '' #local_preload_libraries = ''
#session_preload_libraries = ''




#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Expand Down Expand Up @@ -566,6 +599,7 @@ default_text_search_config = 'pg_catalog.english'
#default_with_oids = off #default_with_oids = off
#escape_string_warning = on #escape_string_warning = on
#lo_compat_privileges = off #lo_compat_privileges = off
#operator_precedence_warning = off
#quote_all_identifiers = off #quote_all_identifiers = off
#sql_inheritance = on #sql_inheritance = on
#standard_conforming_strings = on #standard_conforming_strings = on
Expand Down
2 changes: 1 addition & 1 deletion kaif-deploy/roles/postgresql/vars/main.yml
@@ -1,2 +1,2 @@
postgresql_version: '9.3' postgresql_version: '9.5'
postgresql_db_path: '/volume/lib/postgresql' postgresql_db_path: '/volume/lib/postgresql'

0 comments on commit a918a68

Please sign in to comment.