-
Notifications
You must be signed in to change notification settings - Fork 116
Getting Started
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.
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
There is a shell script called rexster.sh
. When that script is evaluated at the command line with the --start
option, it starts up the Rexster web server.
rexster.sh --start
Rexster Configuration is handled through an XML file. By default, Rexster looks for a file called rexster.xml
in the same directory as rexster.sh
. Please be aware sample rexster.xml
files are provided with the standard Rexster packaging. If that file cannot be found, Rexster tries to load rexster.xml
as a resource packaged within Rexster itself. It is possible to make use of different configuration 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.
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/graphs
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":"*.*",
"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/graphs/tinkergraph
and the result will look like:
{
"version": "*.*",
"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]"
}
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 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:8182/doghouse
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