Product: Columbus
Can I relocate the relational database found under /var/lib/pgsql/data and if so, how best to go about doing this?
If it is not possible to increase the size of the existing /var filesystem/partition then relocating the relational database is an option
IMPORTANT. Please note it is NOT RECOMMENDED to move the relational database (/var/lib/pgsql/data) to a network share or similar, any break in communication between the local server and where the relational db is located may cause data corruption. We cannot guarantee data recovery if this occurs. On that basis we would only suggest relocating the db if the new location is local to the server.
The permissions of the new location for the database MUST retain the same permissions as the original location.
The process varies slightly depending on whether you are running Columbus on the SLES or RHEL Operating System
On SLES the process requires you to edit the POSTGRES_DATADIR parameter in the /etc/sysconfig/postgressql file.
On RHEL the file does not exist by default so you first have to create the file /etc/sysconfig/pgsql/postgresql and add the parameter:
PGDATA=/the/path/to/the/new/location
Be aware that if the PGDATA parameter is changed to anything other than default then the SELinux configuration in recent RHEL releases may cause issues. Further information can be found here:
https://wiki.postgresql.org/wiki/PostgreSQL_on_RedHat_Linux
An overview of the process to move the /var/lib/pgsql/data is described below.
- Stop Columbus and PostgreSQL
$ sudo /etc/init.d/columbus stop
$ sudo /etc/init.d/postgresql stop
- Copy /var/lib/pgsql/data somewhere else e.g.
$ sudo cp -a /var/lib/pgsql/data /some_local_disk/pg_data
- Rename /var/lib/pgsql/data
$ sudo mv /var/lib/pgsql/data /var/lib/pgsql/data-defunct
- For a SLES environment, in the file /etc/sysconfig/postgresql (SLES) change the line
POSTGRES_DATADIR="~postgres/data"
to
POSTGRES_DATADIR="/some_local_disk/pg_data"
For a RHEL environment create the file /etc/sysconfig/pgsql/postgresql, and add the line:
PGDATA=/some_local_disk/pg_data
- Restart Postgres and Columbus
sudo /etc/init.d/postgresql start
sudo /etc/init.d/columbus start
- Check the Columbus status to make sure all services are OK:
$ sudo /etc/init.d/columbus status
- Login to the Columbus webUI and browse the data to make sure it is all accessible.
If Columbus works, you can remove the old copy of the relational database e.g. /var/lib/pgsql/data-defunct
NOTE - Although the Columbus Installation guide suggests using a symbolic link (section 8.12) to link to the new location of /var/lib/pgsql/data, Technical Support would currently recommend the above approach. The use of the Symbolic link can cause further issues as noted in this article.
Comments
0 comments
Article is closed for comments.