Skip to content

Commit

Permalink
Updated postgresql version pinning to 16 (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuechunHou authored Nov 14, 2024
1 parent 789f371 commit 36c6184
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ sudo apt-get -y install gnupg wget
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo wget --no-verbose --output-document=/etc/apt/trusted.gpg.d/postgresql.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
sudo apt-get -y update
sudo apt-get install -y postgresql-14
sudo apt-get install -y postgresql-16

sudo service postgresql restart
sudo su postgres -c "psql postgres -c \"ALTER ROLE postgres WITH PASSWORD 'abc123';\""
sudo su postgres -c "psql postgres -c \"CREATE ROLE replica_user WITH REPLICATION LOGIN PASSWORD 'abc123';\""

DATA_ROOT=/var/lib/postgresql/14
CFG_ROOT=/etc/postgresql/14
DATA_ROOT=/var/lib/postgresql/16
CFG_ROOT=/etc/postgresql/16

### Everything following this comment is designed to set up a paused replica to get replication metrics
sudo tee -a ${CFG_ROOT}/main/postgresql.conf << EOF
Expand Down Expand Up @@ -63,7 +63,7 @@ EOF
sudo chown -R postgres:postgres ${DATA_ROOT}/repl

# start the replica in the background
nohup sudo su postgres -c "/usr/lib/postgresql/14/bin/postgres -D ${DATA_ROOT}/repl" 2>/dev/null >/dev/null </dev/null &
nohup sudo su postgres -c "/usr/lib/postgresql/16/bin/postgres -D ${DATA_ROOT}/repl" 2>/dev/null >/dev/null </dev/null &
# give it time to start, since we put it in the background
sleep 5
# pause the replication so we see delay metrics populated
Expand Down

0 comments on commit 36c6184

Please sign in to comment.