Personal tools

SRB:Installation on naraapp09

From Adapt

Revision as of 18:16, 16 September 2008 by Toaster (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Software Locations

  • SRB installation: /export/srb/srb
  • SRB Unix account: mcat
  • SRB Postgres backups: /export/vault1/backups
  • SRB zone: nara-umiacs
  • SRB Domain: umiacs


SRB Installation

Software

Copied the following from naraapp01

[mcat@naraapp01 srb]$ scp install.pl naraapp09:/export/srb/srb
[mcat@naraapp01 srb]$ tar -cpf - SRB3_4_1 | ssh mcat@naraapp09 "cd /export/srb/srb; tar -xpf - "
[mcat@naraapp01 srb]$ scp postgresql-7.4.8.tar.gz naraapp09:/export/srb/srb
[mcat@naraapp01 srb]$ scp postgresql-7.4.8.tar.gz naraapp09:/export/srb/srb
[mcat@naraapp01 srb]$ scp pg_backup.sh naraapp09:/export/srb/srb

Edit install.pl and set the following:

  • $SRB_FILE="";
  • $SRB_DIR="SRB3_4_1";

around line 1053 in isntall.pl, change the host allow statement to use localhost

runCmdNoLog(0,"echo host all all 128.8.132.108 255.255.255.255 trust | cat >> $postgresData/pg_hba.conf");

[mcat@naraapp09 srb]$ perl install.pl 
This script is install.pl version 3.x, last updated June 28, 2005
This host is narasrb01.umiacs.umd.edu
This host full network name is narasrb01.umiacs.umd.edu
This host full network address is narasrb01.umiacs.umd.edu
...


Don't worry if this fails confioguring the SRB, we'll just over-write it anyways.

[mcat@naraapp09 srb]$ mv pgsql/data pgsql/data1
#ON app01, copy the db over
[mcat@naraapp01 pgsql]$ tar -cpf - data | ssh naraapp09 "cd /export/srb/srb/pgsql; tar -xpf -"

Edit pgsql/data/pg_hba.conf and set the last line to app09's IP address

  • host all all 128.8.132.108 255.255.255.255 trust

Now let's fire it up

[mcat@naraapp09 srb]$ perl install.pl start
This script is install.pl version 3.x, last updated June 28, 2005
This host is narasrb01.umiacs.umd.edu
This host full network name is narasrb01.umiacs.umd.edu
...
[mcat@naraapp09 srb]$ set path=(/export/srb/srb/SRB3_4_1/utilities/bin $path)
[mcat@naraapp09 srb]$ Sinit -v
Using default Port 7618.
Client Release = SRB-3.3.1, API version = G.
Server Release = SRB-3.3.1, API version = G.
Client mcatZone = nara-umiacs
Server mcatZone = nara-umiacs

PostGreSQL Tuning

Now, we have to tune postgres a little bit.

In /etc/sysctl.conf, add:

#
# increase max shared memory to 2GB
kernel.shmmax=2147483648
kernel.shmall=2147483648

You can make it take affect immediately by running:

[root@naraapp01 vault1]# echo 2147483648 > /proc/sys/kernel/shmmax 
[root@naraapp01 vault1]# echo 2147483648 > /proc/sys/kernel/shmall 

In /etc/fstab, add 'noatime' to the mount for /export/srb. In /export/srb/srb/pgsql/data/postgresql.conf change the shared buffers to:

shared_buffers = 200000


IPTables Config

In the UMfiles iptables config, create a new iptables-naraapp01 config and add the following lines after the allow for port 22

######
# tcp
[0:0] -A tcp_packets -p tcp -m tcp --dport 22 -j tcpallowed
[0:0] -A tcp_packets -p tcp -m tcp --dport 7618 -j tcpallowed
[0:0] -A tcp_packets -p tcp -m tcp --dport 20000:20200 -j tcpallowed


Database Backups

Config

The postgresql databases are dumped and vacuumed nightly. The pg_backup.sh in /export/srb/srb is the script used to do this. It dumps backups to /export/vault1/backups. You can restore using the following command (substitute current backup where appropriate)

In pg_backup.sh, edit the following lines:

#
# Postgresql username to perform backups under.
postgresql_username="mcat"

# Postgresql password for the Postgresql username (if required).
postgresql_password="password"

# Postgresql hostname to connect to.
postgresql_hostname="localhost"

##################
# Locations      #
##################
#
# Location to place backups.
location_backup_dir="/export/vault1/backups"

# Location to place the pg_backup.sh logfile.
location_logfile="/export/vault1/backups/dump.log"

# Location of the psql binaries.
location_binaries="/export/srb/srb/pgsql/bin"

##################
# Permissions    #
##################
#
# Permissions for the backup location.
permissions_backup_dir="0750"

# Permissions for the backup files.
permissions_backup_file="0640"
...
...
# You must comment out the line below before using this script
#echo "You must set all values in the configuration section in this file then run ./pg_backup.sh configtest before using this script" && exit 1

Restoring files

gunzip /export/vault1/backups/July-2005/2005-07-01/10:38-postgresql_database-MCAT-backup.gz
pg_restore -d database -F c /export/vault1/backups/July-2005/2005-07-01/10:38-postgresql_database-MCAT-backup

Update to 3.5.0

[mcat@naraapp09 srb]$ tar -xf SRB3.5.0.tar 
[mcat@naraapp09 srb]$ mv SRBInstall/ SRBInstall.old
[mcat@naraapp09 srb]$ cd SRB3_5_0/
[mcat@naraapp09 SRB3_5_0]$ cp ../SRB3_4_1/src/lib/gen_uuid.c  src/lib/gen_uuid.c 
[mcat@naraapp09 SRB3_5_0]$ ./configure --enable-installdir=/export/srb/srb/SRBInstall --enable-psgmcat --enable-psghome=/export/srb/srb/pgsql --enable-commports --enable-commstart=20000 --enable-commnum=200 --enable-srbport=7618
[mcat@naraapp09 SRB3_5_0]$ make; make install
[mcat@naraapp09 SRB3_5_0]$ cd /export/srb/srb/SRBInstall/data
[mcat@naraapp09 data]$ cp /export/srb/srb/SRBInstall.old/data/MdasConfig .
[mcat@naraapp09 data]$ cp /export/srb/srb/SRBInstall.old/data/mcatHost  .
[mcat@naraapp09 data]$ cp /export/srb/srb/SRBInstall.old/data/hostConfig .
[mcat@naraapp09 bin]$ ./runsrb
mv: cannot stat `./../data/srbLog': No such file or directory
rm: cannot remove `./../data/lockDir/.[a-z]*': No such file or directory
rm: cannot remove `./../data/lockDir/CVS': Is a directory
findServerExec: found "/export/srb/srb/SRBInstall/bin/./srbServer" using argv[0]
logFile: ../data/log/srbLog.1.26.8 opened successfully.
ZoneName = NARA-WV  HostName = 207.245.160.69  PortNum = 7618
ZoneName = nara  HostName = erasrb01.nara.gov  PortNum = 7618
ZoneName = nara-dc  HostName = 207.245.162.200  PortNum = 7618
ZoneName = nara-gtri  HostName = bush41.gtri.gatech.edu  PortNum = 7618
ZoneName = nara-renci  HostName = vmmcat.renci.org  PortNum = 5544
ZoneName = nara-sdsc  HostName = srb-mcat.sdsc.edu  PortNum = 7618
NOTICE:Jan 29 16:36:35: srbMaster version SRB-3.5.0&G is up.
findServerExec: found "/export/srb/srb/SRBInstall/bin/./srbServer" using argv[0]
findServerExec: found "/export/srb/srb/SRBInstall/bin/./srbServer" using argv[0]
NOTICE:Jan 29 16:36:35: Connection from 128.8.132.108 by PUser srbAdmin@umiacs Cuser srbAdmin@umiacs, pid = 29654
mcat     29650     1  0 16:36 ?        00:00:00 ./srbMaster-3.5.0 -d 1 -

-- Main.MikeSmorul - 19 Nov 2007