Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ansible/files/adminapi.sudoers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl st
%adminapi ALL= NOPASSWD: /usr/bin/systemctl restart postgresql.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl show -p NRestarts postgresql.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl restart adminapi.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl is-active verify-wal.service
%adminapi ALL= NOPASSWD: /usr/bin/systemctl start verify-wal.service
%adminapi ALL= NOPASSWD: /bin/systemctl daemon-reload
%adminapi ALL= NOPASSWD: /bin/systemctl restart services.slice
%adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf
Expand Down
6 changes: 6 additions & 0 deletions ansible/files/logrotate_config/logrotate-wal-verify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/var/log/wal-g/wal-verification-results/*.json {
weekly
rotate 0
nocreate
missingok
}
12 changes: 12 additions & 0 deletions ansible/files/verify-wal.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Async WAL verification

[Service]
Type=simple
User=adminapi
ExecStart=/usr/bin/admin-mgr wal-verify-timeline --save-output-to-file true
Restart=no
OOMScoreAdjust=-1000

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions ansible/tasks/finalize-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- { file: "logrotate-postgres-csv.conf" }
- { file: "logrotate-postgres.conf" }
- { file: "logrotate-walg.conf" }
- { file: "logrotate-wal-verify.conf" }
- { file: "logrotate-postgres-auth.conf" }

- name: Ensure default Postgres logrotate config is removed
Expand Down
5 changes: 5 additions & 0 deletions ansible/tasks/internal/admin-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
src: files/adminapi.service.j2
dest: /etc/systemd/system/adminapi.service

- name: adminapi - create service file for verify wal process
template:
src: files/verify-wal.service.j2
dest: /etc/systemd/system/verify-wal.service

- name: UFW - Allow connections to adminapi ports
ufw:
rule: allow
Expand Down
2 changes: 2 additions & 0 deletions ebssurrogate/scripts/surrogate-bootstrap-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ function clean_system {

# Setup wal-g logs
mkdir /mnt/var/log/wal-g

touch /mnt/var/log/wal-g/{backup-push.log,backup-fetch.log,wal-push.log,wal-fetch.log,pitr.log}
mkdir /mnt/var/log/wal-g/wal-verification-results

#Creatre Sysstat directory for SAR
mkdir /mnt/var/log/sysstat
Expand Down
2 changes: 2 additions & 0 deletions ebssurrogate/scripts/surrogate-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ function clean_system {

# Setup wal-g logs
mkdir /mnt/var/log/wal-g

touch /mnt/var/log/wal-g/{backup-push.log,backup-fetch.log,wal-push.log,wal-fetch.log,pitr.log}
mkdir /mnt/var/log/wal-g/wal-verification-results

#Creatre Sysstat directory for SAR
mkdir /mnt/var/log/sysstat
Expand Down
3 changes: 3 additions & 0 deletions scripts/91-log_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ mkdir /var/log/postgresql
chown postgres:postgres /var/log/postgresql

mkdir /var/log/wal-g

cd /var/log/wal-g
touch backup-push.log backup-fetch.log wal-push.log wal-fetch.log pitr.log
mkdir /var/log/wal-g/wal-verification-results

chown -R postgres:postgres /var/log/wal-g
chmod -R 0300 /var/log/wal-g

Loading