Projekt mspr@job1
Jump to navigation
Jump to search
How I move the MSPR site from job4 to job1
Preparation
- Install standard opensuse 12.1
- Add repositories pacman, nvidia, vlc
- Install the following packages
zypper install apache2 php5 hg apache2-mod_php5 php5-gd php5-devel php5-pear gcc-c++
- Install db2 express-c 9.7.4
- Create instance db2mspr
- Configure instance like db2inst4 on job4
db2 update dbm cfg using numdb 2 federated yes DFT_MON_BUFPOOL on DFT_MON_LOCK on \ DFT_MON_SORT on DFT_MON_STMT on DFT_MON_TABLE on DFT_MON_UOW on \ INSTANCE_MEMORY 524288 SHEAPTHRES 200000 INTRA_PARALLEL YES
- Create connect user db2inst2 (required because tables have this schema)
- Create loader user mspr (loads data from mspr web/xml pages)
- Clone mspr repository to /home/joachim/workspace/mspr (for scripts and docs)
- Install pdo for db2 (see howto in database/)
- Enable apache to access instance db2mspr (DB2INSTANCE in /etc/sysconfig/apache2, export?)
- Other settings in /etc/sysconfig/apache2
- APACHE_SERVERADMIN="joachim.banzhaf@googlemail.com"
- APACHE_SERVERNAME="banzhaf.homeip.net"
- Add line in /etc/apache2/listen.conf: "Listen 801"
- Install scripts for import and web
- all in web/ except gen_* to /srv/www/htdocs, then move images/ to mspr/images
- util/mspr-* to /usr/local/bin
- database/ta_mqt_refresh.sh to /usr/local/bin
- edit proxy destination (add test port :801 to url)
cd /srv/www/htdocs for i in image index mainframe naviframe titleframe; do sed -i 's/\(homeip.net\)/\1:801/' $i.php; done
- Create password file for db connection /etc/apache/db2inst2.passwd, chown root:mspr, chmod 640
- Create group mspr with members mspr, db2mspr, wwwrun
Test Installation
- restore database from last backup and logs from job4 and document steps (needs 30-100 GB)
db2 restore db mspr on /home/db2mspr db2 restore db mspr logs logtarget `db2 get db cfg for mspr | grep SQLOGDIR | awk -F '= ' '{print $2}'` db2 rollforward db mspr to end of logs and stop db2 activate db mspr
- check db settings are the same as on job4 (should be ok)
- Create portforward public :801 to job1:801
next task:
- Check if pages show correct results
- Setup cron for data imports
- Testrun for data import (check home directory requirement for mspr)
Production Switch
- disable update on job4
- restore db again
- edit proxy destination (remove test port :801 from url)
cd /srv/www/htdocs for i in image index mainframe naviframe titleframe; do sed -i 's/:801//' $i.php; done
- test again
- remove public :801 forward
- forward public :80 to job1:80
- make apache listen to :80 instead of :801
- final tests