Prerequisites
To set up this application we will assume that you have the following tools installed on the target instance:
- git
- Maven 3+
- Tomcat7 (with the manager turned on)
- Mysql 5.5+
Download and build the source code
You can download the source from https://github.com/duracloud/snapshot.
git clone https://github.com/duracloud/snapshot.git
Setup Tomcat
- Set up tomcat server credentials for automatic deployment on build
in your settings.xml file (~/.m2/settings.xml) add the following to the servers element:
<server> <id>tomcat-server</id> <username>tomcat</username> <password>password</password> </server>
Set up environment with the following settings:
duracloud.bridge.root.username - the username used for initializing the instance (default root).
duracloud.bridge.root.password - the password used for initializing the instance (default rpw).
duracloud.bridge.root.email - an email associated with the root account that will send email regarding bridge server events.
duracloud.bridge.root.dir - a directory that will receive data as well as store non-database application state and settings.
in the /etc/default/tomcat7 file add the following parameters to your JAVA_OPTS environmental variable
JAVA_OPTS="$JAVA_OPTS -Dduracloud.bridge.root.password=<your password> -Dduracloud.bridge.root.email=<your email> -Dduracloud.bridge.root.dir=<your root dir>"
Build and deploy the source
cd snapshot mvn clean install
Create the database
Using a mysql client create a database:
CREATE DATABASE 'snapshot' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
Create a DuraCloud User
You will need to create a duracloud user with ROLE_ADMIN permissions in order for the bridge to read data from and write data to DuraCloud. This can be done by your DuraCloud account administrator through https://manage.duracloud.org/
Initialize the application
First you'll need to create an init.json file using the values you setup in previous steps.
{ "originatorEmailAddress" : "<email address>", "duracloudEmailAddresses" : ["<email address>"], "dpnEmailAddresses" : ["<email address>"], "duracloudUsername" : "<duracloud username>", "duracloudPassword" : "<duracloud password", "awsAccessKey" : "<aws key>", "awsSecretKey" : "<aws secret key>", "databaseUser" : "<database user>", "databasePassword" : "<database password>", "databaseURL" : "jdbc:mysql://<database instance>:<database port>/<database name>", "clean" : "true", "finalizerPeriodMs" : 60000, "daysToExpireRestore" : 1 }
Then execute the following curl command to pass the initialization params to the bridge.
curl -v -X POST -d @/path/to/init.json \ -H "Content-Type: application/json" \ -H "Accept:application/json" \ "https://<your bridge host:port>/bridge/init" \ -u <duracloud.bridge.root.username>:<duracloud.bridge.root.password>