diff --git a/inventory b/inventory index 76faf9f7a..14ddd8fc3 100644 --- a/inventory +++ b/inventory @@ -7,25 +7,19 @@ # if dcs_exists: false and dcs_type: "etcd" (in vars/main.yml) [etcd_cluster] # recommendation: 3 or 5-7 nodes -10.128.64.140 -10.128.64.142 -10.128.64.143 - +172.31.14.220 +172.31.1.229 # if with_haproxy_load_balancing: true (in vars/main.yml) [balancers] -10.128.64.140 -10.128.64.142 -10.128.64.143 # PostgreSQL nodes [master] -10.128.64.140 hostname=pgnode01 postgresql_exists='false' +172.31.14.220 hostname=pgnode01 postgresql_exists='false' [replica] -10.128.64.142 hostname=pgnode02 postgresql_exists='false' -10.128.64.143 hostname=pgnode03 postgresql_exists='false' +172.31.1.229 hostname=pgnode02 postgresql_exists='false' [postgres_cluster:children] master @@ -44,12 +38,12 @@ replica [all:vars] ansible_connection='ssh' ansible_ssh_port='22' -ansible_user='root' -ansible_ssh_pass='secretpassword' # "sshpass" package is required for use "ansible_ssh_pass" +ansible_user='ubuntu' +#ansible_ssh_pass='secretpassword' # "sshpass" package is required for use "ansible_ssh_pass" # ansible_ssh_private_key_file= # ansible_python_interpreter='/usr/bin/python3' # is required for use python3 [pgbackrest:vars] -ansible_user='postgres' -ansible_ssh_pass='secretpassword' +#ansible_user='postgres' +#ansible_ssh_pass='postgres' diff --git a/vars/Debian.yml b/vars/Debian.yml index e4c2de185..df6f22fa3 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -22,6 +22,7 @@ apt_repository_keys: - key: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" # postgresql repository apt key apt_repository: - repo: "deb https://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main" # postgresql apt repository + - repo: "deb https://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main 14" # to install 14beta3 or later # - repo: "deb https://deb.debian.org/debian/ {{ ansible_distribution_release }} main" # debian repo (optional) # - repo: "deb https://deb.debian.org/debian/ {{ ansible_distribution_release }}-updates main" # debian repo (optional) # - repo: "deb https://security.debian.org/debian-security/ {{ ansible_distribution_release }}/updates main" # debian repo (optional) @@ -48,12 +49,19 @@ system_packages: - jq - iptables - acl + - moreutils + - libpq-dev + - linux-tools-common + - linux-tools-5.4.0-1045-aws # ubuntu 20.04 postgresql_packages: - postgresql-{{ postgresql_version }} - postgresql-client-{{ postgresql_version }} - postgresql-server-dev-{{ postgresql_version }} - postgresql-contrib-{{ postgresql_version }} + - postgresql-{{ postgresql_version }}-pg-wait-sampling + - postgresql-{{ postgresql_version }}-pg-stat-kcache + - postgresql-{{ postgresql_version }}-dbgsym # - postgresql-{{ postgresql_version }}-repack" # Extra packages @@ -128,6 +136,8 @@ patroni_pip_package_repo: [] patroni_deb_package_repo: [] # - "https://apt.postgresql.org/pub/repos/apt/pool/main/p/patroni/patroni_1.6.5-2.pgdg100%2B1_all.deb" # (package for Debian 10) +# pgcenter +pgcenter_deb_package_file: "https://github.com/lesovsky/pgcenter/releases/download/v0.9.2/pgcenter_0.9.2_linux_amd64.deb" # ================================================================================================= # # (optional) if installation_method: "file" @@ -177,7 +187,8 @@ haproxy_src_file: "haproxy-1.8.20.tar.gz" # http://www.haproxy.org/download/1.8 # ------------------------------------------------------------------------------------------------- # # (optional) Specify additional deb packages if required (for any installation_method) # this packages will be installed before all other packages. -packages_from_file: [] +packages_from_file: + - "pgcenter_0.9.2_linux_amd64.deb" # - "my-package-name_1_amd64.deb" # - "my-package-name_2_amd64.deb" # - "" diff --git a/vars/main.yml b/vars/main.yml index b1b26859e..762e0234d 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -101,16 +101,16 @@ postgresql_extensions: [] # postgresql parameters to bootstrap dcs (are parameters for example) postgresql_parameters: - - {option: "max_connections", value: "100"} + - {option: "max_connections", value: "300"} - {option: "superuser_reserved_connections", value: "5"} - {option: "max_locks_per_transaction", value: "64"} # raise this value (ex. 512) if you have queries that touch many different tables (partitioning) - {option: "max_prepared_transactions", value: "0"} - {option: "huge_pages", value: "try"} # or "on" if you set "vm_nr_hugepages" in kernel parameters - - {option: "shared_buffers", value: "512MB"} # please change this value + - {option: "shared_buffers", value: "20GB"} # please change this value - {option: "work_mem", value: "128MB"} # please change this value - {option: "maintenance_work_mem", value: "256MB"} # please change this value - - {option: "effective_cache_size", value: "4GB"} # please change this value - - {option: "checkpoint_timeout", value: "15min"} + - {option: "effective_cache_size", value: "40GB"} # please change this value + - {option: "checkpoint_timeout", value: "30min"} - {option: "checkpoint_completion_target", value: "0.9"} - {option: "min_wal_size", value: "2GB"} # for PostgreSQL 9.5 and above (for 9.4 use "checkpoint_segments") - {option: "max_wal_size", value: "4GB"} # for PostgreSQL 9.5 and above (for 9.4 use "checkpoint_segments") @@ -133,13 +133,14 @@ postgresql_parameters: - {option: "archive_command", value: "cd ."} # not doing anything yet with WAL-s # - {option: "archive_command", value: "wal-g wal-push %p"} # archive WAL-s using WAL-G # - {option: "archive_command", value: "pgbackrest --stanza={{ pgbackrest_stanza }} archive-push %p"} # archive WAL-s using pgbackrest - - {option: "wal_level", value: "replica"} # "replica" for PostgreSQL 9.6 and above (for 9.4, 9.5 use "hot_standby") + - {option: "wal_level", value: "logical"} # "replica" for PostgreSQL 9.6 and above (for 9.4, 9.5 use "hot_standby") - {option: "wal_keep_segments", value: "130"} + - {option: "wal_compression", value: "on"} - {option: "max_wal_senders", value: "10"} - {option: "max_replication_slots", value: "10"} - {option: "hot_standby", value: "on"} - {option: "wal_log_hints", value: "on"} - - {option: "shared_preload_libraries", value: "pg_stat_statements,auto_explain"} + - {option: "shared_preload_libraries", value: "pg_stat_statements,pg_wait_sampling"} - {option: "pg_stat_statements.max", value: "10000"} - {option: "pg_stat_statements.track", value: "all"} - {option: "pg_stat_statements.save", value: "off"} @@ -169,8 +170,8 @@ postgresql_parameters: # - {option: "max_parallel_workers", value: "24"} # for PostgreSQL 10 and above # - {option: "max_parallel_workers_per_gather", value: "4"} # for PostgreSQL 9.6 and above # - {option: "max_parallel_maintenance_workers", value: "2"} # for PostgreSQL 11 and above -# - {option: "hot_standby_feedback", value: "on"} # allows feedback from a hot standby to the primary that will avoid query conflicts -# - {option: "max_standby_streaming_delay", value: "30s"} + - {option: "hot_standby_feedback", value: "on"} # allows feedback from a hot standby to the primary that will avoid query conflicts + - {option: "max_standby_streaming_delay", value: "1800s"} # - {option: "wal_receiver_status_interval", value: "10s"} # - {option: "old_snapshot_threshold", value: "60min"} # for PostgreSQL 9.6 and above (1min-60d) # - {option: "", value: ""} diff --git a/vars/system.yml b/vars/system.yml index 685e24944..9a4cb8381 100644 --- a/vars/system.yml +++ b/vars/system.yml @@ -32,7 +32,7 @@ locale: "en_US.utf-8" # Kernel parameters -sysctl_set: true # or 'false' +sysctl_set: false # or 'false' # these parameters for example! Specify kernel options for your system sysctl_conf: etcd_cluster: [] @@ -117,7 +117,7 @@ sudo_users: # Firewall (ansible-role-firewall) -firewall_enabled_at_boot: true +firewall_enabled_at_boot: false firewall_allowed_tcp_ports_for: master: []