The Rya Vagrant Example project allows users to quickly get up and running on Rya using a Virtual Machine. Specifically, this project uses Vagrant to create a VM, install Rya on Accumulo, and configure the OpenRDF Workbench Web Application to use Rya.
The Rya Example Box VM requires Vagrant to install, configure, and run the VM. Vagrant is freely available for many host operating systems. More information about Vagrant (including installers) are available at https://www.vagrantup.com/
The Rya Example Box was developed using Vagrant 1.7.4 and Oracle Virtual Box 5.0.6.
If a user would rather not use Vagrant, expert users should be able to read through the Rya-Example-Box Vagrantfile and understand the operations that the Vagrantfile is performing to configure the VM for Rya. These operations should be applicable to other Linux machines and VMs.
Once Vagrant is installed, starting up the Rya-Example-Box is fairly straightforward.
Create a custom directory for the Rya Example Box (e.g., for windows users c:\users\<user>\ryavagrant
or for Mac/Linux users /home/<user>/ryavagrant
)
Download the Rya-Example-Box Vagrantfile to the custom directory. Note that it must be named Vagrantfile
with no extension.
Open a DOS prompt (Windows) or Terminal (Mac/Linux), change to the custom directory, and issue the command vagrant up
. Note that it may take up to 30 minutes to download, install, and configure Rya and all of the components.
By default, the VM should be assigned the IP address of 192.168.33.10
. This value is defined in the Vagrantfile and it is configurable. All of the procedures in this in this document assume that the hostname rya-example-box
resolves to the VM’s IP address 192.168.33.10
. The easiest way to do this is to add the entry 192.168.33.10 rya-example-box
to your machine’s host file (e.g., for windows users modify C:\Windows\System32\drivers\etc\hosts
or for Mac/Linux users modify /etc/hosts
)
Verify the Tomcat instance: Open a browser to http://rya-example-box:8080/. You should see a webpage that says “It works! If you‘re seeing this page via a web browser, it means you’ve setup Tomcat successfully. Congratulations!
Verify the deployed OpenRDF Sesame service: Open your browser to http://rya-example-box:8080/openrdf-sesame/protocol and you should see a 6
(this is the OpenRDF Protocol Version).
Verify the deployed OpenRDF Workbench: Open your browser to http://rya-example-box:8080/openrdf-workbench
Verify the deployed Rya Web: Open your browser to http://rya-example-box:8080/web.rya/sparqlQuery.jsp
Ssh into into the VM: SSH from your host machine to rya-example-box
with user/pass of vagrant/vagrant.
Test the Accumulo shell: After ssh'ing into the VM, run the command: /home/vagrant/accumulo-1.6.5/bin/accumulo shell -u root -p root
Most of the time, the Vagrant script works perfectly and passes all of the verification. However, below are a list of the common issues that we've seen and how to mitigate those issues
As dependencies such as Hadoop and Accumulo are updated, URLs for downloads of old versions can be come stale. If this happens, the vagrant provisioning script should fail. Scrolling back through the output should reveal an error message indicating which download did not work. To fix, try updating the version number specified in the Vagrantfile.
Run these two commands and see if you have any Rya files in the two lib directories:
ls /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/rya* ls /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/rya*
If these files do note exists, open the vagrant file and look for the line echo "Downloading Rya"
. Try working through those commands manually on your Vagrant VM.
OpenRDF Workbench requires a set of “transformations” for listing Rya in the OpenRDF Workbench Repository list. The transforms are in this directory: /var/lib/tomcat7/webapps/openrdf-workbench/transformations/
If these files do note exists, open the vagrant file and look for the line echo "Downloading Rya"
. Try working through those commands manually on your Vagrant VM.
Below is a list of other useful commands on the VMs
#####Log into the VM
cd extras/vagrantExample/src/main/vagrant/
vagrant ssh
Alternatively:ssh vagrant@rya-example-box
with pass: vagrant
)#####Running as Root
Most start and stop scripts require running as root with variables, like %HADOOP_PREFIX% assigned.
sudo -E thecommand theParameters
The -E
preserves environment variables from the current session.Alternatively:
su
with pass: vagrant
)source .accumulo_rc.sh
)exit
)#####Restart Tomcat
sudo -E service tomcat7 restart
#####Restart Accumulo
sudo -E /home/vagrant/accumulo-1.6.5/bin/stop-all.sh
)stop-all
doesn't complete, hit ctrl-c
once and you should see Initiating forced shutdown in 15 seconds
. Wait 15 seconds.sudo -E /home/vagrant/accumulo-1.6.5/bin/start-all.sh
)#####Test and Restart Zookeeper
echo ruok | (nc 127.0.0.1 2181 ; echo)
imok
sudo -E /home/vagrant/zookeeper-3.4.5-cdh4.5.0/bin/zkServer.sh start
List the processes specific to rya.
From the VM, run: ryaps
Output should look like this:
org.apache.zookeeper.server.quorum.QuorumPeerMain org.apache.accumulo.start.Main monitor org.apache.accumulo.start.Main tserver org.apache.accumulo.start.Main master org.apache.accumulo.start.Main gc org.apache.accumulo.start.Main tracer org.apache.catalina.startup.Bootstrap
If you are having issues, or modified the vagrantfile and want to put everything back as specified, then use the provision command. This will overwrite most settings. It will not download nor unpack the libraries, unless you first remove there corresponding folders from the VM's vagrant home folder.
cd extras/vagrantExample/src/main/vagrant/
vagrant provision
To get the full factory-reset, do some of the following before you re-provision:From within the VM, run: sudo rm -r zookeeper-3.4.5-cdh4.5.0/logs
sudo rm -r accumulo-1.6.5/logs/
If you run into the issue where it repeatedly prints: Waiting for accumulo to be initialized
This will allow Accumulo to start up. Remove the data, then reprovision as above. From within the VM, run: sudo rm -r /data
sudo rm -r /var/zookeeper/
The first step to using Rya via the OpenRDF Workbench is to create a repository using the Rya Accumulo Store connector.
New Repository
Rya Accumulo Store
, a Repository “ID” (e.g., RyaAccumulo
), and a Repository “Title” (e.g., Rya Accumulo
). Click on Next
when complete.root
, Accumulo Password: root
, Accumulo Instance: dev
, Zookeepers: localhost
, is Mock?: false
). Click on Create
when complete.Once we've created a Rya repository, we can load data into Rya via the OpenRDF Workbench.
Current Selections: Repository: Rya Accumulo ( RyaAccumulo )
at the top of the page.Add
on the left side of the page.RDF/XML
and “Location of the RDF data you wish to upload” to http://telegraphis.net/data/currencies/currencies.rdf
. All other fields should remain empty. Click on Upload
when complete.Once we've created a Rya repository and uploaded data, we can query Rya via the OpenRDF Workbench.
Open your browser to the OpenRDF Workbench
Verify that OpenRDF Workbench is connected to Rya. The OpenRDF Workbench screen should have Current Selections: Repository: Rya Accumulo ( RyaAccumulo )
at the top of the page.
Click on Query
on the left side of the page.
Use the example SPARQL query below to query for Currencies with a Short Name of “dollar”
PREFIX money:<http://telegraphis.net/ontology/money/money#> select ?name where { ?x a money:Currency . ?x money:shortName "dollar" . ?x money:name ?name . }
More information about the Sesame REST HTTP Protocol is availible in the [OpenRDF 2.7 Docs] (http://rdf4j.org/sesame/2.7/docs/system.docbook?view#The_Sesame_REST_HTTP_Protocol)
TODO
The Rya Web Client provides a user a web gui to query Rya. Once data has been loaded into Rya, we can run the same query as before
Open your browser to the Rya Web page.
Use the example SPARQL query below to query for Currencies with a Short Name of “dollar”
PREFIX money:<http://telegraphis.net/ontology/money/money#> select ?name where { ?x a money:Currency . ?x money:shortName "dollar" . ?x money:name ?name . }
You should see an XML document with the results.
TODO
TODO
Instructions for resizing a Vagrant/VirtualBox image can be found [here] (http://www.midwesternmac.com/blogs/jeff-geerling/resizing-virtualbox-disk-image)