Files
zulip/puppet/zulip_ops/files/postgresql/setup_disks.sh
Alex Vandiver a7d85b7e69 postgresql: Update setup-disks to not move /tmp.
Drop the change to move `/tmp` onto the local disk.  Doing this move
confuses `resolved` until there is a restart, and has no clear
benefits.  The change came in during bf82fadc95, but does not describe
the reasoning; it is particularly puzzling, since postgresql stores
its temporary files under `$PGDATA/base/pgsql_tmp`.
2020-05-30 12:14:24 -07:00

22 lines
468 B
Bash
Executable File

#!/bin/sh
umount /mnt
LOCALDISK=/dev/nvme0n1
mkfs.xfs $LOCALDISK
echo "$LOCALDISK /srv xfs nofail,noatime 1 1" >> /etc/fstab
mount /srv
# TODO use systemctl instead of pg_ctlcluster on CentOS
pg_ctlcluster 9.5 main stop
mv /var/lib/postgresql /srv
ln -s /srv/postgresql/ /var/lib
# TODO use systemctl instead of pg_ctlcluster on CentOS
pg_ctlcluster 9.5 main start
# Disable /mnt line for /dev/xvdb
umount /mnt
sed -i 's|^/dev/xvdb|#/dev/xvdb|' /etc/fstab