1. set starcluater configuration file
mount an EBS to /mnt/galaxyTools
2. launch a spot instance cluster
starcluster start spot_cluster –bid 0.11
3. enable job tolerance of node failure
#to enable resubmitting jobs when nodes die,
#log on the master node,
vi ~/.sge_request
#add the following line and save the change:
-r y
4. set Galaxy job scheduler to SGE
export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6
5. download and set Galaxy
$cd /mnt/galaxyTools
$ hg clone https://bitbucket.org/galaxy/galaxy-central or https://bitbucket.org/galaxy/galaxy-dist
$cd /mnt/galaxyTools/galaxy-dist
$./run.sh
#kill the process by control+c when Galaxy is up
$vi universe_wsgi.ini
#make the following changes to universe_wsgi.ini:
host = 0.0.0.0
start_job_runners = drmaa
default_cluster_job_runner = drmaa:///
#use MySQL instead of the default SQLite
database_connection = mysql://ubuntu@localhost:3306/galaxy_db?unix_socket=/run/mysqld/mysqld.sock
(
#or use postgreSQL instead of the default SQLite
database_connection = postgres:///galaxy_db?user=ubuntu&host=/var/run/postgresql
)
export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6
or (depending on what instances (x86 or x64) you are using)
export DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x64/libdrmaa.so.1.0
export SGE_ROOT=/opt/sge6
(to persist the above setting, add them to the file /etc/profile)
6. create database account and database (use either MySQL or postgreSQL)
#create a MySQL account (ubuntu) since Galaxy is running as ubuntu (you can have it run as another user)
$mysql -u root
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘ubuntu’@’localhost’; //Galaxy should run as ubuntu, if not ubuntu, change to the user correspondingly
mysql>exit
$mysql //log on as ubuntu by default
mysql>create database galaxy_db;//the database name galaxy_db should be consistent with the one above used in the file universe_wsgi.ini
(
#use postgresql instead of SQLite
install postgresql
start postgresql
sudo /etc/init.d/postgresql start
I am running Galaxy under the user ubuntu, so first I create the ubuntu user
sudo -u postgres createuser -D -A -P ubuntu
sudo -u postgres createdb -O ubuntu galaxy_db
sudo -u postgres psql
GRANT ALL ON galaxy_db.* to ubuntu
)
#start Galaxy (should have set DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x86/libdrmaa.so.1.0 or DRMAA_LIBRARY_PATH=/opt/sge6-fresh/lib/linux-x64/libdrmaa.so.1.0 and SGE_ROOT=/opt/sge6 before this step)
$cd /mnt/galaxyTools/galaxy-dist
$./run.sh
#change security group of the cluster by adding 8080
#visit Galaxy
http://EC2 ip address:8080