Difference between revisions of "Wormmart administration"

From WormBaseWiki
Jump to navigationJump to search
Line 104: Line 104:
  
 
*if sudo make install fails, try creating dummy file: ~/src/mod_perl-2.0.4/src/modules/perl/mod_perl.so
 
*if sudo make install fails, try creating dummy file: ~/src/mod_perl-2.0.4/src/modules/perl/mod_perl.so
 +
 +
 +
== Downloading martj ==
 +
 +
Download to ~/src:
 +
ftp://anonymous@ftp.ebi.ac.uk/pub/software/biomart/martj_current/martj-bin.tgz
 +
tar -zxvf martj-bin.tgz
 +
 +
== Downloading biomart-perl ==
 +
cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/biomart login
 +
cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/biomart \
 +
    co -r release-0_7 martj
  
 
== MySQL ==
 
== MySQL ==

Revision as of 11:21, 13 April 2010

Overview

WormMart is WormBase's implementation of the BioMart data warehouse.

Basic Server Configuration

Create groups

sudo addgroup wormbase
sudo addgroup biomart
# Add yourself to the groups
sudo usermod -a -G biomart, wormbase acabunoc

Create directories

Create a directory for GBrowse. For now, we're maintaining GBrowse on dedicated hardware completely distinct from the rest of the web application. This makes updates significantly easier, although it increases maintenance (ie boilerplate headers and footers are maintained in two places). We'll also keep gbrowse inside a wormbase/ directory should we wish to install other components on these servers at a later date.

$ sudo mkdir -p /usr/local/wormbase
$ sudo chgrp -R wormbase /usr/local/wormbase
$ sudo chmod 2775 /usr/local/wormbase

Install prerequisites (Debian)

// Update apt
$ sudo apt-get update
// Make tools
$ sudo apt-get install gcc make
// expat
$ sudo apt-get install expat libexpat1 libexpat1-dev
// GD support
$ sudo apt-get install libgd2-noxpm libgd2-noxpm-dev
// Graphviz, now apparently required by BioPerl
$ sudo apt-get install graphviz
// Curl
$ sudo apt-get install curl

Install Perl 5.10.1 or greater

You'll need Perl version 5.10.1 or greater.

Debian:

$ sudo apt-get install perl

NOTE: This version of Perl on Debian Lenny doesn't ship with perl.h. You won't be able to build mod_perl without it! You should probably build from source.

Building from source:

bash> cd ~/src
bash> curl -O http://www.cpan.org/src/perl-5.10.1.tar.gz
bash> cd ~/build
bash> tar xzf ../src/perl-5.10.1.tar.gz
bash> cd perl-5.10.1
bash> ./Configure -des
  // Or, to install in a local path:
bash> ./Configure -des -Dprefix=$HOME/website/perl/5.10.1
bash> make
bash> make test
bash> sudo make install

Install Apache2

If you're running Debian, get rid of the installed apache. The default layout is just plain annoying.

$ sudo apt-get remove apache2
# Build httpd 2.2.15
cd ~/src
curl -O http://apache.raffsoftware.com/httpd/httpd-2.2.15.tar.gz
tar xzf httpd-2.2.15.tar.gz
cd httpd-2.2.15
./configure --enable-mods-shared=all
make
sudo make install

Apache Configuration

Edit the primary httpd.conf file (/usr/local/apache2/conf/httpd.conf) with the appropriate port, virtual host, and fcgi settings:

  • Set httpd to listen on your desired port. In the examples below, we assume port 8080.
# Edit "Listen 80" to read
Listen 8080


Install mod_perl

cd ~/src
wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
tar zxvf mod_perl-2.0-current.tar.gz
cd mod_perl-2.0.4 
perl Makefile.PL \
    PREFIX=/usr/local/apache2 \
    MP_APXS=/usr/local/apache2/bin/apxs

Add to httpd.conf:

LoadModule perl_module modules/mod_perl.so

Then,

sudo make install
  • if sudo make install fails, try creating dummy file: ~/src/mod_perl-2.0.4/src/modules/perl/mod_perl.so


Downloading martj

Download to ~/src: ftp://anonymous@ftp.ebi.ac.uk/pub/software/biomart/martj_current/martj-bin.tgz

tar -zxvf martj-bin.tgz

Downloading biomart-perl

cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/biomart login
cvs -d :pserver:cvsuser@cvs.sanger.ac.uk:/cvsroot/biomart \
    co -r release-0_7 martj

MySQL

Each node in the renderfarm has its own MySQL databases.

Installation (>= 5.1)

We need a newer version of mysql than is available from the package manager. We'lll install the binary for x86_64.

$ sudo groupadd mysql
$ sudo useradd -g mysql mysql
$ sudo usermod -a -G mysql tharris
$ cd /usr/local
$ sudo gunzip < /path/to/mysql-VERSION-OS.tar.gz | sudo tar xvf -
$ sudo ln -s full-path-to-mysql-VERSION-OS mysql
$ cd mysql
$ sudo chown -R mysql .
$ sudo chgrp -R mysql .
$ sudo scripts/mysql_install_db --user=mysql  // may be necessary to remove /etc/mysql/my.cnf first
$ sudo chown -R root .
$ sudo chown -R mysql data
$ sudo chmod 2775 data // I like to be able to write to my datadir
// Copy the configuration file
$ sudo cp support_files/my-medium.cnf /etc/my.cnf
// It may be necessary to add the following to my.cnf if back end nodes
// don't have fully qualified domain names
skip-name-resolve
// Set up mysql to start up automatically
$ sudo cp support_files/mysql.server /etc/init.d/.
$ cd /etc/rc3.d
$ sudo ln -s ../init.d/mysql.server S90mysql
$ cd ../rc5.d
$ sudo ln -s ../init.d/mysql.server S90mysql
// Start it up and set a root password.
$ sudo /etc/init.d/mysql.server start
$ mysqladmin -u root password 'PASSWORD'

Databases

MySQL databases will be mirrored over directly as part of the production update process. They should be located in /usr/local/mysql/data. Symlinks, using the symbolic name of the database, point to the current version:

 c_elegans -> c_elegans_WS211

Privileges

Be sure to grant privileges to both master and slave servers to the databases:

$ mysql -u root -p -e 'grant select on c_elegans.* to nobody@localhost'
$ mysql -u root -p -e 'grant select on c_elegans.* to nobody@render-slave-ip'

Install Requisite Perl Modules

All libraries specific for GBrowse are maintained in a local shared directory. This makes it easier and faster to upgrade GBrowse, but more difficult to test multiple versions simultaneously. To test a new version of GBrowse, place extlib inside of the gbrowse-current directory and modify the apache configuration and commands below as appropriate.

Install local::lib to make things easier:

$ sudo perl -MCPAN -e 'CPAN::install(local::lib)'
$ cd /usr/local/wormbase/extlib

To install modules to this path:

$ perl -Mlocal::lib=.
$ eval $(perl -Mlocal::lib=./)
$ sudo rm -rf ~/.cpan
$ perl -MCPAN -e shell
cpan> install Bio::Perl        // may be necessary to install from source
cpan> install Bio::Graphics    // may be necessary to install from source