Skip to content

Commit 04ba19a

Browse files
Merge pull request #12 from brianbroderick/pg10update
Pg10update
2 parents e1e4d56 + a60993d commit 04ba19a

17 files changed

Lines changed: 675 additions & 543 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
\#*#
66
.*.sw[a-z]
77
*.un~
8+
*.note
89

910
# Bundler
1011
Gemfile.lock

chef_postgres/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ This cookbook is designed to make it easy to install Postgres 9.1+ on an EC2 Ubu
22

33
The root recipes are chef_postgres::master and chef_postgres::standby. Set up the master first. This will create a pg_basebackup dump that is uploaded to S3 (partially using the server_name in the S3 path) along with the settings required for the recovery.conf file on the standby.
44

5-
Once the master is set up, run chef_postgres::standby. This grabs the backup from S3 and uses this to deploy the standby.
5+
Once the master is set up, run chef_postgres::standby. This grabs the backup from S3 and uses this to deploy the standby.
6+
7+
The data_device is for the data drive added to the machine. When you add this in Aws match the last letter from the device name. i.e.
8+
Aws drop down option "/dev/sdk" Translates to "/dev/xvdk". It will always be xvd you just have to change the last letter to match. The default is listed below.
69

710
To change the default settings, pass in custom JSON. These are the defaults:
811

@@ -13,11 +16,13 @@ To change the default settings, pass in custom JSON. These are the defaults:
1316
"release_apt_codename": "codename_reported_by_ec2",
1417
"version": "9.6",
1518
"workload": "oltp",
19+
"data_device": "/dev/xvdl",
20+
"rootdrive": "/dev/xvda1"
1621
"s3": {
1722
"region": "",
1823
"bucket": "",
1924
"access_key_id": "",
20-
"secret_access_key": ""
25+
"secret_access_key": ""
2126
}
2227
}
2328
}
@@ -33,7 +38,7 @@ For workload, the options are:
3338

3439
"oltp" - Online Transaction Processing
3540
* Generally CPU or I/O intensive
36-
* DB can be slightly larger than RAM
41+
* DB can be slightly larger than RAM
3742
* Writes are usually small
3843
* Some long transactions and complex read queries
3944

chef_postgres/attributes/default.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
default["chef_postgres"]["version"] = "9.6"
66
default["chef_postgres"]["rh_version"] = node["chef_postgres"]["version"].gsub(/[^0-9]/, "")
77
default["chef_postgres"]["workload"] = "oltp"
8+
default["chef_postgres"]["data_device"] = "/dev/xvdl"
9+
default["chef_postgres"]["rootdrive"] = "/dev/nvme0n1p1"
810

911
version = node["chef_postgres"]["version"]
1012

11-
default["chef_postgres"]["pg_config"]["mount_drive"] = "/dev/xvda1"
1213
default["chef_postgres"]["pg_config"]["config_directory"] = "/etc/postgresql/#{version}/main"
1314
default["chef_postgres"]["pg_config"]["original_data_directory"] = "/var/lib/postgresql/#{version}/main"
1415
default["chef_postgres"]["pg_config"]["data_directory_on_separate_drive"] = true

chef_postgres/files/pg_hba.conf

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
# or "samenet" to match any address in any subnet that the server is
4343
# directly connected to.
4444
#
45-
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
46-
# "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
47-
# "password" sends passwords in clear text; "md5" is preferred since
48-
# it sends encrypted passwords.
45+
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
46+
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
47+
# Note that "password" sends passwords in clear text; "md5" or
48+
# "scram-sha-256" are preferred since they send encrypted passwords.
4949
#
5050
# OPTIONS are a set of options for the authentication in the format
5151
# NAME=VALUE. The available options depend on the different
@@ -59,11 +59,11 @@
5959
# its special character, and just match a database or username with
6060
# that name.
6161
#
62-
# This file is read on server startup and when the postmaster receives
63-
# a SIGHUP signal. If you edit the file on a running system, you have
64-
# to SIGHUP the postmaster for the changes to take effect. You can
65-
# use "pg_ctl reload" to do that.
66-
62+
# This file is read on server startup and when the server receives a
63+
# SIGHUP signal. If you edit the file on a running system, you have to
64+
# SIGHUP the server for the changes to take effect, run "pg_ctl reload",
65+
# or execute "SELECT pg_reload_conf()".
66+
#
6767
# Put your actual configuration here
6868
# ----------------------------------
6969
#
@@ -72,30 +72,23 @@
7272
# listen on a non-local interface via the listen_addresses
7373
# configuration parameter, or via the -i or -h command line switches.
7474

75+
# CAUTION: Configuring the system for local "trust" authentication
76+
# allows any local user to connect as any PostgreSQL user, including
77+
# the database superuser. If you do not trust all your local users,
78+
# use another authentication method.
7579

7680

77-
78-
# DO NOT DISABLE!
79-
# If you change this first entry you will need to make sure that the
80-
# database superuser can access the database using some other method.
81-
# Noninteractive access to all databases is required during automatic
82-
# maintenance (custom daily cronjobs, replication, and similar tasks).
83-
#
84-
# Database administrative login by Unix domain socket
85-
local all postgres trust
86-
8781
# TYPE DATABASE USER ADDRESS METHOD
8882

8983
# "local" is for Unix domain socket connections only
90-
local all all md5
84+
local all all trust
85+
host all all 0.0.0.0/0 md5
9186
# IPv4 local connections:
92-
host all all 127.0.0.1/32 md5
93-
# IPv4 remote connections - change this line if you want to limit access to specific IP ranges.
94-
host all all 0.0.0.0/0 md5
87+
host all all 127.0.0.1/32 trust
9588
# IPv6 local connections:
96-
host all all ::1/128 md5
89+
host all all ::1/128 trust
9790
# Allow replication connections from localhost, by a user with the
9891
# replication privilege.
99-
#local replication postgres peer
100-
#host replication postgres 127.0.0.1/32 md5
101-
#host replication postgres ::1/128 md5
92+
local replication all trust
93+
host replication all 127.0.0.1/32 trust
94+
host replication all ::1/128 trust

0 commit comments

Comments
 (0)