Required Dependencies

Java

OpenCGA needs Java 8 to compile and run, we recommend to use Oracle JDK 1.8.0_60+ since is the one we use and therefore it is fully supported. There are two main ways of installing Oracle JDK in Linux: via package manager and manually.

Installing via package manager can be more or less easy to do depending on the Linux distribution you use, for example for Ubuntu 16.04 you can execute the following commands:

Tomcat

OpenCGA needs Tomcat 8 to run RESTful web services, we recommend to use Apache Tomcat 8.x since is the one we use in production but we have also used Jetty with any problem. You can install Apache Tomcat in Linux either via package manager or manually.

Installing via package manager can be more or less easy to do depending on the Linux distribution you use, keep in mind that Tomcat should run with the same user that OpenCGA. We will assume that OpenCGA will be installed with user opencga. Run the following to set Tomcat to run with user opencga. for example for Ubuntu 16.04 you can execute the following command:

Shell

## You need root permissions
sudo apt-get install tomcat8
## You can check that Tomcat is running by executing
sudo service tomcat8 status
## Run the following to set Tomcat to run with user opencga
cd /var/lib/tomcat8/
sudo service tomcat8 stop
sudo chown -RL opencga:opencga ./*
## Edit the files /etc/init.d/tomcat8 and /etc/default/tomcat8
TOMCAT8_USER=opencga
TOMCAT8_GROUP=opencga
## Then reload the service and restart
sudo systemctl daemon-reload
sudo service tomcat8 start

MongoDB 3.2

OpenCGA uses MongoDB 3.2.x+ to store Catalog database and also as a possible backened for the Variant Storage engine. The best ways of installing MongoDB is from the Linux package managers, you can follow MongoDB tutorials for Ubuntu and RedHat/CentOS at:

You can customise server configuration at /etc/mongodb.conf or the client at ~/.mongorc.js. Some recommended configuration for MongoDB:

Always use WiredTiger engine

Make sure the journal is enabled

Make sure to have one directory per db with: directoryperdb=true

For cluster installation we recommend to set up a Replica Set, this will improve performance and will make the installation more robust.

Apache Solr

Apache Solr 6.x is used in OpenCGA as a complementary search engine for improving the performance of some queries and aggregations, full text search and faceted queries to Variant database. Solr is highly reliable, scalable and fault tolerant NoSQL database, it provides distributed indexing, replication, load-balanced querying, automated fail over, recovery, centralised configuration and more. You can learn how to install Solr at https://cwiki.apache.org/confluence/display/solr/Installing+Solr.

OpenCGA needs to be able to create new Solr collections and provide the Variant search schema. To do this you need to download the OpenCGAConfSet.tar.gz if you are using OpenCGA version 1.2.x or 1.3.x, for next version 1.4.0 you must use OpenCGAConfSet_1.4.x.tar.gz, then you just need to uncompress it and copy it into your Solr folder installation.

For Solr standalone installation, you have to copy the OpenCGAConfSet configuration into the folder server/solr/configsets for Solr standalone installation. Now, you can create new core or collections dynamically from Solr command line or from REST web services, e.g.:

For Solr cloud installation, you have to upload the OpenCGAConfSet configuation to your cluster by running the Solr zookeeper command line. In the following example command line, the OpenCGAConfSet configuration is located in the folder server/solr/configsets:

Optional Dependencies

Apache Maven

OpenCGA uses Apache Maven 3.x as building tool, we use maven to compile, build, install and run tests of OpenCGA, so you do not need Maven unless you want to compile and build the source code for any reason, you can follow Installation Guide > Building from Source Code instructions to learn how to do it. Remember that you can always get stable OpenCGA binaries from Installation Guide#GettingOpenCGA.

Maven can be easily installed in Linux via package manager, you can execute with sudo or as root the following commands in Ubuntu or CentOS: