################################################################
# VDT-dCache Package #
# Postgres/PNFS Upgrade Instructions #
################################################################
The latest VDT-dCache package provides dCache-1.9.2-11. If you upgrading from
vdt-release 2.3.0-2.3.3 this is security upgrade for srm and fix for srm database leak.
The only step you have to perform is the step #4(Upgrade dCache software on all nodes (following instructions mentioned in README file)
If you are upgrading from 2.3.4 this is gratia probe upgrade. You will need to upgrade gratia probes on your admin and srm nodes.
If you are upgrading from 2.8.8 this is a significant upgrade that also requires upgrade of Postgres
and PNFS Server software, we have provided this document.
The purpose of this document is to provide instructions for
o Upgrade of Postgres from version 8.1.4 to version 8.3.5
o Upgrade of PNFS Server software from version 3.1.10-7 to version 3-1-12-2f
Finally, you need to upgrade all dCache-1.8.0-15 nodes to dCache-1.9.2-11
Order in which this should be done
++++++++++++++++++++++++++++++++++
1) Upgrade Postgres on PNFS node
2) Upgrade PNFS Server software on PNFS node
3) Upgrade Postgres on Admin and SRM node
4) Upgrade dCache software on all nodes (following instructions mentioned
in README file)
Assumptions
+++++++++++
o INSTALL_DIR - directory in which new vdt-dcache tarball is to be installed
/usr/local/
o OLD_INSTALL_DIR - directory in which previous vdt-dcache tarball is installed
/usr/local/vdt-dcache-SL4_32-2.2.8
o Special database user account name is "postgres". Yours may be different.
Note:
o Following upgrade is performed on SL4 32 bit node. The name of rpms
will be different for a different OS/Arch.
o Postgres upgrade may take several hours depending on size of the database.
So, "be patient".
Ok, Lets Begin
++++++++++++++
1) On all nodes, download the vdt-dcache-2.3.2 tarball and untar it. I assume
its installed in /usr/local so our INSTALL_DIR is
/usr/local/vdt-dcache-SL4_32-2.3.2
2) On all nodes, stop all currently running dCache services and Postgres
On Pool Nodes: /etc/init.d/pool stop
On Gridftp/dCap door Nodes: /etc/init.d/dcache stop
On SRM node: /etc/init.d/dcache stop
On Admin node: /etc/init.d/dcache stop
On PNFS node: /etc/init.d/dcache stop
/etc/init.d/pnfs stop
/etc/init.d/postgres stop
On Admin node: /etc/init.d/postgres stop
On SRM node: /etc/init.d/postgres stop
3) Upgrade Postgres on PNFS node
a. Set the value of PGDATA variable to location of your Postgres data directory
example:
# export PGDATA=/opt/pgsql/data
or
# export PGDATA=/var/lib/pgsql/data
b. Start the Postgres server
# /etc/init.d/postgresql start
c. cd in to INSTALL_DIR/vdt-dcache-SLx_y-2.3.2/install and backup the old data
# cd /usr/local/vdt-dcache-SL4_32-2.3.2/install/
# pg_dumpall -U postgres > backup.sql
Note: If you need to preserve OIDs (such as when using them as foreign keys),
then use the -o option when running pg_dumpall.
d. Stop the Postgres server
# /etc/init.d/postgresql stop
e. Backup the old Postgres base directory, just in case you need it later
#mv ${PGDATA} ${PGDATA}.old
f. Preserve old postgresql.conf and old pg_hba.conf for reference
in location of your choice
g. Install the new rpms
Note: I had to use the --nodeps option below because old PNFS server
requires libpq.so.4, which is provided by the old postgres library.
This is okay, since we will be upgrading the PNFS software anyways.
# cd /usr/local/vdt-dcache-SL4_32-2.3.2/RPMS
# rpm -Uvh --nodeps --nosignature postgresql-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-devel-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-libs-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-server-8.3.5-1PGDG.rhel4.i386.rpm
Note: For SL4/SL5/64 bit machines, you need to install 2 additional rpms
compat-postgresql-libs-4-1PGDG.rhel"x".i686.rpm
compat-postgresql-libs-4-1PGDG.rhel"x".x86_64.rpm
where "x" can be 4 or 5
h. If user other than "postgres" is used, make following change in the
startup script /etc/init.d/postgresql:
change username "postgres" to "your_dbadmin_username" everywhere.
i. As root, change permissions on old Postgres base directory
# chown postgres:postgres /var/lib/pgsql
j. Make sure PGDATA variable points to location of your Postgres data directory
example:
# export PGDATA=/opt/pgsql/data
or
# export PGDATA=/var/lib/pgsql/data
As user postgres, create new data directory and initialize it
#initdb -D ${PGDATA} --locale=C
k. Make sure you adjust postgresql.conf file according to your node resources.
Make sure you have autovacuuming enabled!
example settings -
.........
shared_buffers = 256MB # You need at least 256MB
.........
work_mem = 128MB
.........
max_fsm_pages = 1000000
.........
Note: It's important that you set the above values according to what's available
on your machine. Else, the Postgres startup will fail due to error indicating
that the shared memory segment exceeded your kernel's SHMMAX parameter.
l. Make sure all needed entries are present in pg_hba.conf
(most likely you can just copy the old pg_hba.conf on top of the new one,
but make sure syntax has not changed)
m. As root, start postgres to make sure it starts up with all config changes
you made
# /etc/init.d/postgresql start
n. Restore the data from backup
# cd /usr/local/vdt-dcache-SL4_32-2.3.2/install/
# psql -U postgres -f backup.sql template1
4) Upgrade PNFS Server software on PNFS node
a. cd in to INSTALL_DIR/vdt-dcache-SLx_y-2.3.2
# cd /usr/local/vdt-dcache-SL4_32-2.3.2
b. cd in to RPMS dir
# cd RPMS/
c. Install the new rpm
# rpm -Uvh pnfs-postgresql-3-1-12-2f-i386.rpm
# rpm -qa | grep pnfs
5) Upgrade Postgres on Admin node (Only if, admin and PNFS nodes are different)
a. Start the Postgres server
# /etc/init.d/postgresql start
b. cd in to INSTALL_DIR/vdt-dcache-SLx_y-2.3.2 directory and backup the old data
# cd /usr/local/vdt-dcache-SL4_32-2.3.2/install/
# pg_dumpall -U postgres > outputfile
Note: If you need to preserve OIDs (such as when using them as foreign keys),
then use the -o option when running pg_dumpall.
c. Stop the Postgres server
# /etc/init.d/postgresql stop
d. Backup the old Postgres base directory, just in case you need it later
# mv /var/lib/pgsql /var/lib/pgsql.old
e. cd in to INSTALL_DIR/RPMS directory
# cd /usr/local/vdt-dcache-SL4_32-2.3.2/RPMS/
f. Preserve old postgresql.conf and old pg_hba.conf for reference
in location of your choice
g. Install the new rpms
# rpm -Uvh postgresql-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-devel-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-libs-8.3.5-1PGDG.rhel4.i386.rpm
postgresql-server-8.3.5-1PGDG.rhel4.i386.rpm
# rpm -qa | grep postgres
h. As root, change permissions on Postgres base directory
# chown postgres:postgres /var/lib/pgsql
i. As user postgres, create new data directory and initialize it
# initdb -D /var/lib/pgsql/data
j. Make sure you adjust postgresql.conf file according to your node resources.
Make sure you have autovacuuming enabled!
example settings -
.........
shared_buffers = 256MB # You need at least 256MB
.........
work_mem = 128MB
.........
max_fsm_pages = 1000000
.........
Note: It's important that you set the above values according to what's available
on your machine. Else, the Postgres startup will fail due to error indicating
that the shared memory segment exceeded your kernel's SHMMAX parameter.
k. Make sure all needed entries are present in pg_hba.conf
(most likely you can just copy the old pg_hba.conf on top of the new one,
but make sure syntax has not changed)
l. As root, start postgres to make sure it starts up with all config changes
you made
# /etc/init.d/postgresql start
m. Restore the data from backup
# psql -U postgres -d postgres -f outputfile
6) Upgrade Postgres on SRM node (Only if its not an admin or PNFS node)
Follow exactly same instructions as mentioned in step 4 above.
Note: Please ignore the postgres error message that says
"You are now connected to database "postgres".
psql:outputfile:11: ERROR: role "postgres" already exists"
7) Finally, upgrade the dCache software on all nodes following the instructions in
the INSTALL_DIR/install/README file
References
++++++++++
For Postgres upgrade instructions
https://plone4.fnal.gov/P0/DCache/dcachedoc/administrative-procedures/postgresql-upgrade-procedure
www.postgresql.org
Questions
+++++++++
osg-storage@opensciencgrid.org