Hi,
I have the unique situation of burning through OS disks every 5-6 months because of high I/O with zabbix. (the root disk is an SD card. Failure signs show up after 3 months with high latency.) I set up a solution to have the database run on an externally mounted medium more suited to higher writes, and plan to run backups for the database in cron with rsync to my storage node to easily change the storage out and restore the zabbix database easier. I'm currently Re-imaging the entire disk every 6 months, which requires at least 60 minutes of downtime.
I consulted many pages about "how to move a postgres database" which all match what I've done. I also can't see the data_directory for zabbix to double check I moved it.
Thank you all for your time.
I have the unique situation of burning through OS disks every 5-6 months because of high I/O with zabbix. (the root disk is an SD card. Failure signs show up after 3 months with high latency.) I set up a solution to have the database run on an externally mounted medium more suited to higher writes, and plan to run backups for the database in cron with rsync to my storage node to easily change the storage out and restore the zabbix database easier. I'm currently Re-imaging the entire disk every 6 months, which requires at least 60 minutes of downtime.
- The new location for postgres is: /mnt/database
- The file /etc/postgresql/11/main/postgresql.conf was updated to change to the following:
Code:
data_directory = '/mnt/database/postgresql/11/main/' hba_file = '/mnt/database/postgresql/11/main/pg_hba.conf' ident_file = '/mnt/database/postgresql/11/main/pg_ident.conf'
- The permissions were preserved using rsync -av, but here they are anyway:
Code:
root@bishop# ls -la /mnt/database/ total 28 drwxr-xr-x 4 postgres postgres 4096 Mar 26 18:29 . drwxr-xr-x 3 root root 4096 Mar 26 17:11 .. drwxr-xr-x 2 postgres postgres 16384 Mar 26 17:01 lost+found drwxr-xr-x 3 postgres postgres 4096 Mar 6 2020 postgresql
- I've restarted postgresql, which comes up as active(exited), and of course, zabbix cannot run as a result.
I consulted many pages about "how to move a postgres database" which all match what I've done. I also can't see the data_directory for zabbix to double check I moved it.
Code:
root@bishop# sudo -u zabbix psql -U zabbix -tA -c "SHOW data_directory;" ERROR: must be superuser or a member of pg_read_all_settings to examine "data_directory"

Comment