Skip to content

Commit 19afe3a

Browse files
committed
2-node env for tests-and-benchmarks#20
1 parent 2b265ba commit 19afe3a

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

inventory

+8-14
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,19 @@
77

88
# if dcs_exists: false and dcs_type: "etcd" (in vars/main.yml)
99
[etcd_cluster] # recommendation: 3 or 5-7 nodes
10-
10.128.64.140
11-
10.128.64.142
12-
10.128.64.143
13-
10+
172.31.14.220
11+
172.31.1.229
1412

1513
# if with_haproxy_load_balancing: true (in vars/main.yml)
1614
[balancers]
17-
10.128.64.140
18-
10.128.64.142
19-
10.128.64.143
2015

2116

2217
# PostgreSQL nodes
2318
[master]
24-
10.128.64.140 hostname=pgnode01 postgresql_exists='false'
19+
172.31.14.220 hostname=pgnode01 postgresql_exists='false'
2520

2621
[replica]
27-
10.128.64.142 hostname=pgnode02 postgresql_exists='false'
28-
10.128.64.143 hostname=pgnode03 postgresql_exists='false'
22+
172.31.1.229 hostname=pgnode02 postgresql_exists='false'
2923

3024
[postgres_cluster:children]
3125
master
@@ -44,12 +38,12 @@ replica
4438
[all:vars]
4539
ansible_connection='ssh'
4640
ansible_ssh_port='22'
47-
ansible_user='root'
48-
ansible_ssh_pass='secretpassword' # "sshpass" package is required for use "ansible_ssh_pass"
41+
ansible_user='ubuntu'
42+
#ansible_ssh_pass='secretpassword' # "sshpass" package is required for use "ansible_ssh_pass"
4943
# ansible_ssh_private_key_file=
5044
# ansible_python_interpreter='/usr/bin/python3' # is required for use python3
5145

5246
[pgbackrest:vars]
53-
ansible_user='postgres'
54-
ansible_ssh_pass='secretpassword'
47+
#ansible_user='postgres'
48+
#ansible_ssh_pass='postgres'
5549

vars/Debian.yml

+7
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,19 @@ system_packages:
4848
- jq
4949
- iptables
5050
- acl
51+
- moreutils
52+
- libpq-dev
53+
- linux-tools-common
54+
- linux-tools-5.4.0-1045-aws # ubuntu 20.04
5155

5256
postgresql_packages:
5357
- postgresql-{{ postgresql_version }}
5458
- postgresql-client-{{ postgresql_version }}
5559
- postgresql-server-dev-{{ postgresql_version }}
5660
- postgresql-contrib-{{ postgresql_version }}
61+
- postgresql-{{ postgresql_version }}-pg-wait-sampling
62+
- postgresql-{{ postgresql_version }}-pg-stat-kcache
63+
- postgresql-{{ postgresql_version }}-dbgsym
5764
# - postgresql-{{ postgresql_version }}-repack"
5865

5966
# Extra packages

vars/main.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ postgresql_extensions: []
101101

102102
# postgresql parameters to bootstrap dcs (are parameters for example)
103103
postgresql_parameters:
104-
- {option: "max_connections", value: "100"}
104+
- {option: "max_connections", value: "300"}
105105
- {option: "superuser_reserved_connections", value: "5"}
106106
- {option: "max_locks_per_transaction", value: "64"} # raise this value (ex. 512) if you have queries that touch many different tables (partitioning)
107107
- {option: "max_prepared_transactions", value: "0"}
108108
- {option: "huge_pages", value: "try"} # or "on" if you set "vm_nr_hugepages" in kernel parameters
109-
- {option: "shared_buffers", value: "512MB"} # please change this value
109+
- {option: "shared_buffers", value: "20GB"} # please change this value
110110
- {option: "work_mem", value: "128MB"} # please change this value
111111
- {option: "maintenance_work_mem", value: "256MB"} # please change this value
112-
- {option: "effective_cache_size", value: "4GB"} # please change this value
113-
- {option: "checkpoint_timeout", value: "15min"}
112+
- {option: "effective_cache_size", value: "40GB"} # please change this value
113+
- {option: "checkpoint_timeout", value: "30min"}
114114
- {option: "checkpoint_completion_target", value: "0.9"}
115115
- {option: "min_wal_size", value: "2GB"} # for PostgreSQL 9.5 and above (for 9.4 use "checkpoint_segments")
116-
- {option: "max_wal_size", value: "4GB"} # for PostgreSQL 9.5 and above (for 9.4 use "checkpoint_segments")
116+
- {option: "max_wal_size", value: "64GB"} # for PostgreSQL 9.5 and above (for 9.4 use "checkpoint_segments")
117117
- {option: "wal_buffers", value: "32MB"}
118118
- {option: "default_statistics_target", value: "1000"}
119119
- {option: "seq_page_cost", value: "1"}
@@ -133,13 +133,14 @@ postgresql_parameters:
133133
- {option: "archive_command", value: "cd ."} # not doing anything yet with WAL-s
134134
# - {option: "archive_command", value: "wal-g wal-push %p"} # archive WAL-s using WAL-G
135135
# - {option: "archive_command", value: "pgbackrest --stanza={{ pgbackrest_stanza }} archive-push %p"} # archive WAL-s using pgbackrest
136-
- {option: "wal_level", value: "replica"} # "replica" for PostgreSQL 9.6 and above (for 9.4, 9.5 use "hot_standby")
136+
- {option: "wal_level", value: "logical"} # "replica" for PostgreSQL 9.6 and above (for 9.4, 9.5 use "hot_standby")
137137
- {option: "wal_keep_segments", value: "130"}
138+
- {option: "wal_compression", value: "on"}
138139
- {option: "max_wal_senders", value: "10"}
139140
- {option: "max_replication_slots", value: "10"}
140141
- {option: "hot_standby", value: "on"}
141142
- {option: "wal_log_hints", value: "on"}
142-
- {option: "shared_preload_libraries", value: "pg_stat_statements,auto_explain"}
143+
- {option: "shared_preload_libraries", value: "pg_stat_statements,pg_stat_kcache,pg_wait_sampling"}
143144
- {option: "pg_stat_statements.max", value: "10000"}
144145
- {option: "pg_stat_statements.track", value: "all"}
145146
- {option: "pg_stat_statements.save", value: "off"}

vars/system.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ locale: "en_US.utf-8"
3232

3333

3434
# Kernel parameters
35-
sysctl_set: true # or 'false'
35+
sysctl_set: false # or 'false'
3636
# these parameters for example! Specify kernel options for your system
3737
sysctl_conf:
3838
etcd_cluster: []
@@ -117,7 +117,7 @@ sudo_users:
117117

118118

119119
# Firewall (ansible-role-firewall)
120-
firewall_enabled_at_boot: true
120+
firewall_enabled_at_boot: false
121121

122122
firewall_allowed_tcp_ports_for:
123123
master: []

0 commit comments

Comments
 (0)