Public | Automated Build

Last pushed: 2 years ago
Short Description
Titan is a free, open source graph database that can support different storage backends.
Full Description

Titan is a free, open source database that is capable of processing extremely large graphs and it supports a variety of indexing and storage backends, which makes it easier to extend than some popular NoSQL Graph databases.

This docker image instantiates a Titan graph database that is capable of integrating with an ElasticSearch container (Indexing) and a Cassandra container (Storage).

The default distribution of Titan runs on a single node, so I thought it would be helpful if there was a modular way at runtime to hook up Titan to its dependencies.

Now it is possible to run Titan and it's dependencies in separate Docker containers.

Titan

This container is using Titan 0.5.4. Please refer to its page for more information.

Tinkerpop and Rexster

Tinkerpop is a vendor-independent API specification for manipulating and access Graph databases.

Rexster is a service that provides protocols for accessing a graph database. Currently it supports two protocols: - REST over HTTP: Human-readable and good for testing - RexPro: Binary Protocol for performance

If you'd like to avoid vendor lock-in, then I'd recommend using Rexster as the API for accessing your Graph database. It has support for popular graph databases, so you can avoid refactoring your code. Take a look at Tinkerpop Gremlin for a Groovy-DSL for querying graphs to see how RexPro and Gremlin provide syntactical elegance to query graphs.

Running

The minimum system requirements for this stack is 1 GB with 2 cores.

docker run -d --name es1 elasticsearch

docker run -d --name cs1 cassandra

docker run -d -P --name mytitan --link es1:elasticsearch --link cs1:cassandra apobbati/titan-rexster

Ports

8182: HTTP port for REST API

8183: RexPro for native access (Binary protocol)

8184: JMX Port (You won't need to use this, probably)

You can read more about it in the Rexster documentation.

To test out the REST API (over Boot2docker):

curl http://localhost:8182/graphs/graph

The sample output should look similar to the below text:

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json;charset=UTF-8
Date: Fri, 10 Jul 2015 02:24:42 GMT
Transfer-Encoding: chunked
server: grizzly/2.2.16

{
    "features": {
        "ignoresSuppliedIds": true,
        "isPersistent": true,
        "isWrapper": false,
        "supportsBooleanProperty": true,
        "supportsDoubleProperty": true,
        "supportsDuplicateEdges": true,
        "supportsEdgeIndex": false,
        "supportsEdgeIteration": true,
        "supportsEdgeKeyIndex": false,
        "supportsEdgeProperties": true,
        "supportsEdgeRetrieval": true,
        "supportsFloatProperty": true,
        "supportsIndices": false,
        "supportsIntegerProperty": true,
        "supportsKeyIndices": true,
        "supportsLongProperty": true,
        "supportsMapProperty": true,
        "supportsMixedListProperty": true,
        "supportsPrimitiveArrayProperty": true,
        "supportsSelfLoops": true,
        "supportsSerializableObjectProperty": true,
        "supportsStringProperty": true,
        "supportsThreadedTransactions": true,
        "supportsTransactions": true,
        "supportsUniformListProperty": true,
        "supportsVertexIndex": false,
        "supportsVertexIteration": true,
        "supportsVertexKeyIndex": false,
        "supportsVertexProperties": true
    },
    "graph": "titangraph[cassandrathrift:[172.17.0.34]]",
    "name": "graph",
    "queryTime": 1.128082,
    "readOnly": false,
    "type": "com.thinkaurelius.titan.graphdb.database.StandardTitanGraph",
    "upTime": "0[d]:00[h]:06[m]:45[s]",
    "version": "2.5.0"
}

I've tested this container with the following containers:

  • cassandra: This is the Cassandra Storage backend for Titan. It scales well for large datasets.
  • elasticsearch: This is the ElasticSearch Indexing backend for Titan. It provides search capabilities for Titan graph datasets.

Roadmap

In the near future, I'd like to add support for:

  • Scaling/Clustering Cassandra and ElasticSearch backends.
  • External volumes for persistent data.
  • Security between Titan and its backends.
  • Example application stack integrating with Titan.
Docker Pull Command
Owner
apobbati
Source Repository

Comments (4)
jimwatkins
2 years ago

To work past the connecting to cassandra timeout I logged into the Cassandra node and enabled the thrift server via the nodetool (i.e. "nodetool enablethrift"). Not sure if the latest cassandra image disabled thrift or something like that.

oreng
2 years ago

docker run -d --name es1 elasticsearch

f8a2d1849428eb7558f59024c4bc4fe99411d74fdf2e641387bb138d2c62bf7f

docker run -d --name cs1 cassandra

bf49ad83d4c770833abe6575b7d8b83a9b0b1d876a07781c753f03eaf92cc412

docker ps

CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                                         NAMES
bf49ad83d4c7        cassandra           "/docker-entrypoint.   3 seconds ago       Up 1 seconds        7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp   cs1
f8a2d1849428        elasticsearch       "/docker-entrypoint.   9 seconds ago       Up 8 seconds        9200/tcp, 9300/tcp                            es1

docker run -P --name mytitan --link es1:elasticsearch --link cs1:cassandra apobbati/titan-rexster

Connecting to Elasticsearch (172.17.0.7:9300). OK (connected to 172.17.0.7:9300).
Connecting to Cassandra (172.17.0.8:9160)........................... timeout exceeded (60 seconds): could not connect to 172.17.0.8:9160
apobbati
2 years ago

@elubow Thanks for the information. I have updated the instructions and also updated to Titan 0.5.4 and Java 8.

Try it out!

elubow
2 years ago

The dockerfile/elasticsearch docker instance is no longer available. I swapped it out and replaced it with itzg/elasticsearch and it appears to work fine.