Personal tools

Chronopolis:Beta SRB Installation

From Adapt

Jump to: navigation, search

Software Location

  • SRB host: chronopolis-mcat.umiacs.umd.edu
  • SRB installation: /export/srb/srb
  • SRB Unix account: mcat
  • SRB Vault location: /export/vault01/vault
  • SRB Postgres backups: /export/vault01/backups
  • SRB zone: chronopolis-umiacs
  • SRB Domain: umiacs
  • SRB Admin User: umiacsSrbAdmin


SRB Installation

Software

Download the following into /export/srb/srb:

Configuration

In the install.pl edit the following variables and set to the values below:

$SRB_FILE="SRB3.4.1.tar"
$SRB_FILE_ALREADY_DECRYPTED=1;
$POSTGRES_FILE="postgresql-7.4.8.tar.gz";
$YOUR_ADMIN_PW="adminpw";
$YOUR_DOMAIN="umiacs";
$YOUR_ZONE="chronopolis-umiacs";
$RESOURCE_NAME="chronopolis-mcat-unix1";
$RESOURCE_DIR="/export/vault01/vault";
$SRB_PORT="7618";
$IP_ADDRESS_LOCALHOST="chronopolis-mcat.umiacs.umd.edu";
$SRB_COMMPORTS="1";
$SRB_COMMNUM="200";
$SRB_COMMSTART="20000";

around line 1053, change the host allow statement to use localhost

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

Installation

Now, do the actual installation. This is a bit of a mess since we have to apply patches and from that I can tell, install.pl doesn't let you apply patches prior to doing the install. (All this done from /export/srb/srb)

[mcat@naraapp03 srb]$ openssl enc -d -bf-cbc -in SRB3.4.1rele_bf.tar -out SRB3.4.1.tar
enter bf-cbc decryption password:
[mcat@naraapp03 srb]$ perl install.pl 
This script is install.pl version 3.x, last updated June 28, 2005
This host is chronopolis-mcat.umiacs.umd.edu
This host full network name is chronopolis-mcat.umiacs.umd.edu
This host full network address is chronopolis-mcat.umiacs.umd.edu
...
...
Some examples for testing and learning about the SRB are at:
http://www.sdsc.edu/srb/Edinburgh-Tutorials-May-2004/scmds.txt .
If your MCAT becomes slow, see index and vacuum options (top of script)
To use the SRB Scommands set your path to include the binaries:
set path=(/export/srb/srb/SRB3_4_1/utilities/bin $path)
Then Sinit, Sls, Sput, Sexit, etc should work.
To stop the the postgres and srb servers, run 'install.pl stop'
To restart the postgres and srb servers, run 'install.pl start'
To show the postgres and srb server processes, run 'install.pl ps'
For man pages (csh): alias Sman 'man -M /export/srb/srb/SRB3_4_1/utilities/man'
All done

Patching

Install the uuid generation.

[mcat@naraapp03 srb]$ perl install.pl stop
This script is install.pl version 3.x, last updated June 28, 2005
This host is chronopolis-mcat.umiacs.umd.edu
This host full network name is chronopolis-mcat.umiacs.umd.edu
This host full network address is chronopolis-mcat.umiacs.umd.edu
...
...
running: /export/srb/srb/pgsql/bin/pg_ctl stop 
Done stopping SRB and Postgres servers
Done at install.pl line 411.
[mcat@naraapp03 srb]$ cp gen_uuid.c SRB3_4_1/src/lib/gen_uuid.c 
[mcat@naraapp03 srb]$ cd SRB3_4_1
[mcat@naraapp03 SRB3_4_1]$ make install
gcc -c -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPORTNAME_linux -DPARA_OPR=1 -DFED_MCAT  -I./src/include  -DMYSRB -DMCAT_VERSION_20 -DCOMM_PORT_NUM_START=20000 -DCOMM_PORT_NUM_COUNT=200 -DSRB_DATADIR='"../data"' 
...
...
mkdir: cannot create directory `/export/srb/srb/SRBInstall': File exists
chmod 755 /export/srb/srb/SRBInstall/data/lockDir /export/srb/srb/SRBInstall/data/CVS
[mcat@naraapp03 SRB3_3_1]$ cd ..
[mcat@naraapp03 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@naraapp03 srb]$ set path=(/export/srb/srb/SRB3_4_1/utilities/bin $path)
[mcat@naraapp03 srb]$ Sinit -v
Using default Port 7618.
Client Release = SRB-3.4.1, API version = G.
Server Release = SRB-3.4.1, API version = G.
Client mcatZone = chronopolis-umiacs
Server mcatZone = chronopolis-umiacs
[mcat@naraapp01 srb]$ chmod 750 pg_backup.sh 

PostGreSQL Tuning

Now, we have to tune postgres a little bit.

In /etc/sysctl.conf, add:

#
# increase max shared memory to 1gb
kernel.shmmax=1073741824
kernel.shmall=1073741824

You can make it take affect immediately by running:

[root@naraapp03 vault1]# echo 1073741824 > /proc/sys/kernel/shmmax 
[root@naraapp03 vault1]# echo 1073741824 > /proc/sys/kernel/shmall 

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

shared_buffers = 114688


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

Now add it to cron

00 03 * * * /export/srb/srb/pg_backup.sh bva > /dev/null 2>&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