Now that you have installed all the packages and configured the machine you can go ahead and start a new instance of the webserver. In it's simplest form it is comprised of 4 pieces, the frontend Rails application, 1 instance of the backend server, 1 instance of the queue daemon and a mysql database.

Start the mysql instance on your machine#

1) sudo /etc/init.d/mysql start
2) Log in to the mysql instance
3) Set the root password to something secure
4) Ensure the root users has all privledges
> update user set Select_priv="Y", Insert_priv="Y", Update_priv="Y",
Delete_priv="Y", Create_priv="Y",Drop_priv="Y",Reload_priv="Y",
Shutdown_priv="Y",Process_priv="Y",File_priv="Y",Index_priv="Y",
Alter_priv="Y",Show_db_priv="Y",Create_tmp_table_priv="Y",
Lock_tables_priv="Y", Grant_priv="Y", References_priv="Y",
Super_priv="Y", Execute_priv="Y",Repl_slave_priv="Y",
Repl_client_priv="Y", Create_view_priv="Y", Show_view_priv="Y",
Create_routine_priv="Y", Alter_routine_priv="Y", Create_user_priv="Y",
Event_priv="Y",Trigger_priv="Y" where user="root";
5) Create a rails user and set their password to something secure, usually called RoR but it doesn't matter what you call it
6) Give the rails users read/write/create/update privileges
>update user set Select_priv="Y", Insert_priv="Y", Update_priv="Y", 
Delete_priv="Y",  Create_priv="Y",Drop_priv="Y",Reload_priv="Y",
Shutdown_priv="Y",Process_priv="Y",File_priv="Y",Index_priv="Y",
Alter_priv="Y",Show_db_priv="Y",Create_tmp_table_priv="Y",
Lock_tables_priv="Y" where user=RoR;
7) As root you may also have to create the backend databases
> create database NewPred_development;
> create database NewPred_production;
8) Log out of the database

Create a rails user#

1) sudo useradd rails

Get a copy of the Frontend and Backend Code#

1) su rails
2) cd ~/
3) svn checkout svn+ssh://dbuchan@bioinfdev.cs.ucl.ac.uk/svndata/NewPred3/trunk NewPred3
4) svn checkout svn+ssh://dbuchan@bioinfdev.cs.ucl.ac.uk/svndata/NewPredServer/trunk NewPredServer

Start the database#

1) /etc/rc.d/init.d/mysqld start
2) check that it is up by logging in and checking that the NewPred_development and NewPred_production databases are there

Initialise the database#

If AND ONLY IF this is the first time starting the server run rake to set up the database for production
1) cd ~/NewPred
2) rake db:migrate
3) That should build the development database with the schema specified by the Rails migrations (assuming the mysql user in your database.yml has the correct privileges).

Start the front end#

1) We'll run all the server process in their own screen session, to make things maintainable
2) screen -S frontend (makes a new screen session if needed)
3) cd ~/NewPred3/
4) sudo /usr/sbin/httpd -k start OR on bioinfdev you can start webrick in the usual way: rails server
5) The Rails server should now be visible via a web browser on port 80, test it out
6) Check MACHINE.cs.ucl.ac.uk/bio_serf to see if it can see the job queue 6) exit the screen session with ctrl-a+d

Start the queue daemon#

1) screen -S runner
2) cd ~/NewPred3/
3) /usr/local/bin/ruby script/rails runner -e production Job.poll_all_loop
4) The queue daemon should now be seen to poll the jobs table in the database every 20-30 seconds
5) exit the screen session with ctrl-a+d

Start the backend node#

You will need to compile the NewPredServer jar. I suggest you, checkout the NewPredServer code, import to Netbeans or Eclipse, compile, then copy over the NewPredServer.jar to the /NewPredServer/dist/ dir where you are about to start the server
1) screen -S backend
2) cd ~/NewPredServer/
3) java -Xmx1024m -jar NewPredServer.jar OR ./run_bioinf.sh
4) You should see the RPC server notes as it comes live
5) exit the screen session with ctrl-a+d

Update the backend server configurations for your new webserver#

1) Go to http://YOURMACHINE:3000/configurations
2) Click New Server
3) Change localhost to //localhost/newpredserver/
4) Change http://127.0.0.1:8080/ to http://127.0.0.1:8083/
5) The frontend now knows that there is an instance of NewPredServer running on it's localhost on port 8083

Add the job configuration for the jobs your want to test#

Then click New Configuration You need to create configurations for the services that new pred will run (services names at the top are case sensitive). These set out where a service will find it's executables and it's default settings for running things. Feel free to change things to reflect where you've actually put things.

Sample Default Configurations can be found on this page

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 21-Mar-2013 17:51 by UnknownAuthor