Difference between revisions of "NDPF Database Server"

From PDP/Grid Wiki
Jump to navigationJump to search
m
 
Line 51: Line 51:
 
Then, on stolp:
 
Then, on stolp:
  
# remove the MySQL-server rpm with  
+
# remove the MySQL-server rpm with "rpm -e MySQL-server"
rpm -e MySQL-server
 
 
# wipe all of /var/lib/mysql/ (note: this is a symlink to a dedicated partition)
 
# wipe all of /var/lib/mysql/ (note: this is a symlink to a dedicated partition)
 
# put in place the right my.cnf, my.cfg files (latter should be symlink to former). They can be found in the home directory of root
 
# put in place the right my.cnf, my.cfg files (latter should be symlink to former). They can be found in the home directory of root

Revision as of 07:00, 26 August 2009

Server Essentials

The current server details are:

  • hosted at stolp.nikhef.nl, located in rack C09U18
  • database server supported: MySQL 5.1
  • databases hosted:
itb_cns
itb_dpm
itb_lfc
itb_lfc_db
mysql
ndpf_cns
ndpf_dpm
ndpf_lfc
voms_dteam
voms_GIN_GGF_ORG
voms_TEST

Configuring a new server

Installed as a database server with the following configuration:

  • Use new PE2960 from Generics 2008/A series: 4x500GB SATA on PERC6/i controller, 24 GB RAM, 2x4-core 2.83 GHz E5440
  • RAID-5 over disks 1,2,3, HS (global, proximity) on disk 4
  • installed with CentOS5U3 with patches (including latest kernel for 2692), see [https://www.nikhef.nl/grid/ndpf/files/local/install/stolp.nikhef.nl.ks]
  • installed MySQL 5.1.37 Community edition (pick the latest 5.1 series), e.g. from
http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.37-0.rhel5.x86_64.rpm/from/http://mirror.leaseweb.com/mysql/

and download/mirror all of 'server', 'client', 'shared', 'shared-compat', and maybe debuginfo as well

  • allow all hosts in the farm to talk through deel/nikopn to 3306 in farmnet-grid (194.171.97.0/24)
  • configure iptables to allow 3306 connections from selected hosts. The default configuration is triggered by the kickstart file from the scripts in [https://www.nikhef.nl/grid/ndpf/files/local/install], but these make it a gridSrv default node
  • change the root ssh affiliation to ndpfPrivilegedUsers (from gridSrvPrivilegedUsers)
  • install xinetd and include host in rsync-backup on beerput

About MySQL

The downloaded MySQL 5.1.37 EL5/x86-64 RPMs in /www/grid/ndpf/files/MySQL-5.1.37-RHEL5-x86-64/ should NOT be linked to the packages/ repository, as by default the MySQL.com client will provide a version of MySQL that will replace the OS-provided one. This triggers subsequent errors in php-mysql and will block any future yum auto-updates.

Tools and scripts

Migration plan

To migrate from bedstee to stolp in a safe way, try:

  1. stop all services that depend on the database. In ELPROD: dpns, dpm (both tbn18), lfc (klomp), and voms (karnton); in the ITB also dpm and lfc.
  2. stop the mysql daemon on bedstee
  3. block inbound port 3306 on bedstee in iptables
  4. restart mysql on bedstee
  5. run the dump-mysql.sh script to generate the latest database dump
  6. copy the dump files for the content databases to stolp
  7. do NOT copy the mysql database itself (the layout has changed in 5.1)
  8. STOP the mysql server again

Then, on stolp:

  1. remove the MySQL-server rpm with "rpm -e MySQL-server"
  2. wipe all of /var/lib/mysql/ (note: this is a symlink to a dedicated partition)
  3. put in place the right my.cnf, my.cfg files (latter should be symlink to former). They can be found in the home directory of root
  4. change directory to the place where you copied the bedstee dumps (and ONLY those, and NO historic or old versions!)
  5. re-install MySQL-server using the restoredb.sh script, found in "~root/" on stolp. Use the specific database root password when requested. The source of the script is at [https://www.nikhef.nl/grid/ndpf/files/local/install/restoredb.sh]
  6. restart mysql for good measure
  7. also for good measure
chkconfig mysql on
chkconfig xinetd on

Then, on all services:

  1. change references from bedstee to stolp in Quattor
  2. push all changes and restart services
  3. see if it all works

Lastly:

  1. do a chkconfig mysql off on bedstee
  2. see if /etc/mysql exists on stolp
  3. run a test backup with dump-mysql.sh on stolp (source at [https://www.nikhef.nl/grid/ndpf/files/tmp/dump-mysql.sh]
  4. check if dump-mysql.sh is in the crontab for root
  5. run a backfrom from beerput to see if the mysql dump files make it to there

After one day:

  1. check if the mysql dump files made it to ADSM