Skip to content

Getting Started

spmallette edited this page Aug 30, 2011 · 57 revisions

The Rexster distribution comes with a Grateful Dead dataset. The raw data is located here. This section will describe the basics of loading up the Rexster web server and accessing some basic services.

Building and Installing Rexster

There are two ways to start working with Rexster: building the latest from source or downloading a pre-built version. Building Rexster from the latest source code, assumes that you have Git installed and Maven and can be accomplished with the following commands:

git clone https://github.com/tinkerpop/rexster.git
cd rexster
mvn clean install

Starting the Rexster Web Server

There is a shell script called rexster-start.sh. When that script is evaluated at the command line, it starts up the Rexster web server. Please be aware that the rexster.xml file is provided with Rexster (see rexster.xml). It is possible to make use of different properties through a different XML file by calling:

rexster.sh --start -c other.xml
[INFO] WebServer - .:Welcome to Rexster:.
[INFO] GraphConfigurationContainer - Graph emptygraph - tinkergraph[vertices:0 edges:0] loaded
[INFO] RexsterApplicationGraph - Graph [tinkergraph] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph tinkergraph - tinkergraph[vertices:6 edges:6] loaded
[INFO] RexsterApplicationGraph - Graph [tinkergraph-readonly] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph tinkergraph-readonly - (readonly)tinkergraph[vertices:6 edges:6] loaded
[INFO] RexsterApplicationGraph - Graph [gratefulgraph] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph gratefulgraph - tinkergraph[vertices:809 edges:8049] loaded
[INFO] GraphConfigurationContainer - Graph sailgraph - sailgraph[memorystore] loaded
[INFO] GraphConfigurationContainer - Graph orientdbsample -  not enabled and not loaded.
[INFO] GraphConfigurationContainer - Graph neo4jsample -  not enabled and not loaded.
[INFO] GraphConfigurationContainer - Graph dexsample -  not enabled and not loaded.
[INFO] MapResultObjectCache - Cache constructed with a maximum size of 1000
[INFO] WebServer - Web Server configured with com..sun..jersey..config..property..packages: com.tinkerpop.rexster
[INFO] WebServer - No servlet initialization parameters passed for configuration: admin-server-configuration
[INFO] WebServer - Rexster Server running on: [http://localhost:8182]
[INFO] WebServer - Dog House Server running on: [http://localhost:8183]
[INFO] ShutdownManager$ShutdownSocketListener - Bound shutdown socket to /127.0.0.1:8184. Starting listener thread for shutdown requests.

GETing the Basics

When the web server is loaded, it is possible to get the list of of currently loaded graphs as well as other server information by accessing the base-URI:

http://localhost:8182

The result of GETing this base-URI should look as follows (consider using the JSONView plugin for Firefox or Chrome for nicely formatted JSON)

{
    "version":"0.5-SNAPSHOT",
    "name":"Rexster: A RESTful Graph Shell",
    "graphs":["tinkergraph","gratefulgraph","sailgraph","emptygraph"],
    "queryTime":1.82123,
    "upTime":"0[d]:00[h]:00[m]:07[s]"
}

To look at the properties of an individual graph and what Extensions it has associated with it, then append the names of one of the values from the “graphs” array above to the base-URI as in:

http://localhost:8182/tinkergraph

and the result will look like:

{
  "version":"0.5-SNAPSHOT",
  "name":"tinkergraph",
  "graph":"tinkergraph[vertices:809 edges:8049]",
  "read_only":false,
  "type":"com.tinkerpop.blueprints.pgm.impls.tg.TinkerGraph",
  "queryTime":0.623691,
  "upTime":"0[d]:00[h]:00[m]:24[s]",
  "extensions":[{"title":"evaluate an ad-hoc Gremlin script for a graph.","href":"tp\/gremlin"}]}

Reading more about the Basic REST API for Rexster will help in learning more about how general access to the graph will work.

The Dog House

The Dog House provides for browser-based access to some of the underlying Rexster services (basic vertex/edge browsing and Gremlin console) and by default is available at:

http://localhost:8183

Stopping the Rexster Web Server

To shutdown the web server:

rexster.sh --stop

This will properly release resources and shutdown the server and exit. The following will appear in the server console:

[INFO] ShutdownManager$ShutdownSocketHandler - Received request for shutdown
[INFO] ShutdownManager - Calling ShutdownListener: com.tinkerpop.rexster.WebServer$1@559113f8
[INFO] RexsterApplication - Shutting down tinkergraph - tinkergraph[vertices:6 edges:6]
[INFO] RexsterApplication - Shutting down gratefulgraph - tinkergraph[vertices:809 edges:8049]
[INFO] RexsterApplication - Shutting down tinkergraph-readonly - (readonly)tinkergraph[vertices:6 edges:6]
[INFO] RexsterApplication - Shutting down sailgraph - sailgraph[memorystore]
[INFO] RexsterApplication - Shutting down emptygraph - tinkergraph[vertices:0 edges:0]
[INFO] ShutdownManager - ShutdownListener com.tinkerpop.rexster.WebServer$1@559113f8 complete
[INFO] ShutdownManager - Calling ShutdownListener: ShutdownListener [bindHost=/127.0.0.1, port=8184]
[INFO] ShutdownManager - ShutdownListener ShutdownListener [bindHost=/127.0.0.1, port=8184] complete
[INFO] ShutdownManager$ShutdownSocketListener - Caught SocketException on shutdownSocket, assuming close() was called: java.net.SocketException: Socket closed
[INFO] ShutdownManager - Calling ShutdownListener: JVM Shutdown Hook Remover
[INFO] ShutdownManager - ShutdownListener JVM Shutdown Hook Remover complete
Clone this wiki locally