-
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.
./bin/rexster.sh --start
Note that using the rexster.bat
requires backslashes instead of forwardslashes at the command line.
Rexster Configuration is handled through an XML file. By default, Rexster looks for a file called rexster.xml
in the root of the working directory. 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:
./bin/rexster.sh --start -c other.xml
[INFO] WebServer - .:Welcome to Rexster:.
[INFO] WebServer - Using [/rexster/rexster-server/rexster.xml] as configuration source.
[INFO] RexsterApplicationGraph - Graph [emptygraph] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph emptygraph - mocktinkertransactionalgraph[vertices:0 edges:0] loaded
[INFO] RexsterApplicationGraph - Graph [tinkergraph] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph tinkergraph - mocktinkertransactionalgraph[vertices:6 edges:6 directory:data/graph-example-1] loaded
[INFO] RexsterApplicationGraph - Graph [tinkergraph-readonly] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph tinkergraph-readonly - readonlyindexablegraph[tinkergraph[vertices:6 edges:6 directory:data/graph-example-1]] loaded
[INFO] RexsterApplicationGraph - Graph [gratefulgraph] - configured with allowable namespace [tp:gremlin]
[INFO] GraphConfigurationContainer - Graph gratefulgraph - tinkergraph[vertices:809 edges:8049 directory:data/graph-example-2] loaded
[INFO] GraphConfigurationContainer - Graph emptysailgraph - not enabled and not loaded.
[INFO] GraphConfigurationContainer - Graph sailgraph - not enabled and not 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] GraphConfigurationContainer - Graph remotetinkergraph - not enabled and not loaded.
[INFO] WebServer - Rexster Server running on: [http://localhost:8182]
[INFO] WebServer - Rexster configured with no security.
[INFO] WebServer - RexPro serving on port: [8184]
[INFO] ShutdownManager$ShutdownSocketListener - Bound shutdown socket to /127.0.0.1:8183. 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 Graph Server",
"graphs": [
"tinkergraph",
"gratefulgraph",
"tinkergraph-readonly",
"emptygraph"
],
"queryTime": 3.480889,
"upTime": "0[d]:00[h]:06[m]:53[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": "mocktinkertransactionalgraph[vertices:6 edges:6 directory:data/graph-example-1]",
"features": {
"ignoresSuppliedIds": false,
"supportsTransactions": false,
"supportsSelfLoops": true,
"supportsBooleanProperty": true,
"supportsEdgeKeyIndex": true,
"supportsUniformListProperty": true,
"supportsThreadedTransactions": false,
"isPersistent": true,
"supportsVertexIndex": true,
"supportsStringProperty": true,
"supportsIntegerProperty": true,
"isWrapper": false,
"supportsMixedListProperty": true,
"supportsVertexKeyIndex": true,
"isRDFModel": false,
"supportsLongProperty": true,
"supportsVertexIteration": true,
"supportsKeyIndices": true,
"supportsEdgeIteration": true,
"supportsPrimitiveArrayProperty": true,
"supportsDoubleProperty": true,
"supportsSerializableObjectProperty": true,
"supportsIndices": true,
"supportsEdgeIndex": true,
"supportsMapProperty": true,
"supportsFloatProperty": true,
"supportsDuplicateEdges": true
},
"readOnly": false,
"type": "com.tinkerpop.rexster.util.MockTinkerTransactionalGraph",
"queryTime": 1.297372,
"upTime": "0[d]:00[h]:08[m]:17[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:
./bin/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@6437a04c
INFO: Stopped listener bound to [0.0.0.0:8182]
[INFO] RexsterApplicationImpl - Shutting down tinkergraph - mocktinkertransactionalgraph[vertices:6 edges:6 directory:data/graph-example-1]
[INFO] RexsterApplicationImpl - Shutting down gratefulgraph - tinkergraph[vertices:809 edges:8049 directory:data/graph-example-2]
[INFO] RexsterApplicationImpl - Shutting down tinkergraph-readonly - readonlyindexablegraph[tinkergraph[vertices:6 edges:6 directory:data/graph-example-1]]
[INFO] RexsterApplicationImpl - Shutting down emptygraph - mocktinkertransactionalgraph[vertices:0 edges:0]
[INFO] ShutdownManager - ShutdownListener com.tinkerpop.rexster.WebServer$1@6437a04c complete
[INFO] ShutdownManager - Calling ShutdownListener: ShutdownListener [bindHost=/127.0.0.1, port=8183]
[INFO] ShutdownManager - ShutdownListener ShutdownListener [bindHost=/127.0.0.1, port=8183] complete
[INFO] ShutdownManager - Calling ShutdownListener: JVM Shutdown Hook Remover
[INFO] ShutdownManager$ShutdownSocketListener - Caught SocketException on shutdownSocket, assuming close() was called: java.net.SocketException: socket closed
[INFO] ShutdownManager - ShutdownListener JVM Shutdown Hook Remover complete