Chapter 7. Titan Server


Titan uses the Gremlin Server engine as the server component to process and answer client queries.

Gremlin Server provides a way to remotely execute Gremlin scripts against one or more Titan instances hosted within it. By default, client applications can connect to it via WebSockets with a custom subprotocol (there are a number of clients developed in different languages to help support the subprotocol). Gremlin Server can also be configured to serve a simple REST-style endpoint for processing Gremlin as well. These configurations just represent the out-of-the-box options for Gremlin Server. It is certainly possible to also extend it with other means of communication by implementing the interfaces that it provides.

The Titan Download comes pre-configured to run Gremlin Server without any additional configuration. Alternatively, one can Download Gremlin Server separately and then install Titan manually.

7.1. Getting Started

  • Download a copy of the current titan-$ file from the Downloads page
  • Unzip it and enter the titan-$VERSION directory
  • Run bin/ start. This step will start Gremlin Server with Cassandra/ES forked into a separate process.
$ bin/ start
Forking Cassandra...
Running `nodetool statusthrift`.. OK (returned exit status 0 and printed string "running").
Forking Elasticsearch...
Connecting to Elasticsearch ( OK (connected to
Forking Gremlin-Server...
Connecting to Gremlin-Server ( OK (connected to
Run to connect.

7.2. Connecting to Gremlin Server

Gremlin Server will be ready to listen for WebSocket connections when it is started. The easiest way to test the connection is with Gremlin Console.

Start Gremlin Console with bin/ and use the :remote and :> commands to issue Gremlin to Gremlin Server:

$  bin/
         (o o)
plugin activated: tinkerpop.server
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.utilities
plugin activated: aurelius.titan
plugin activated: tinkerpop.tinkergraph
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Connected - localhost/
gremlin> :> graph.addVertex("name", "stephen")
gremlin> :> g.V().values('name')

The :remote command tells the console to configure a remote connection to Gremlin Server using the conf/remote.yaml file to connect. That file points to a Gremlin Server instance running on localhost. The :> is the "submit" command which sends the Gremlin on that line to the currently active remote.


To start Titan Server with the REST API, find the conf/gremlin-server/gremlin-server.yaml file in the distribution and edit it. Modify the channelizer setting to be then start Titan Server.