Using gremlin-server with titan-cassandra-es

205 views
Skip to first unread message

Xander Uiterlinden

unread,
Aug 11, 2016, 6:27:48 AM8/11/16
to Aurelius
Hi,

I'm trying to get the gremlin-server to work. I did the following:

1. Download and unzip titan-1.0.0-hadoop1.zip

When cd'ing into bin and running titan.sh I can successfully connect to the gremlin server and interact with the graph.

Looking at the gremlin-server config however I noticed it's configured to use berkeleyje. I wanted the gremlin server to work with cassandra, so I modified the gremlin-server.yaml config file to point to the titan-cassandra-es.properties configuration file. When I start the server everything seems fine, but I cannot successfully use it with the gremlin console.

gremlin> :remote connect tinkerpop.server ../conf/remote.yaml

==>Connected - localhost/127.0.0.1:8183

gremlin> :> g.V().count()

Host did not respond in a timely fashion - check the server status and submit again.


What am I missing here ?


Can someone clarify why it makes sense to have the default titan.sh script start cassandra, elasticsearch and gremlin-server where the latter does not seem to use cassandra but berkeleyje ?


Thanks,


Xander

Stephen Mallette

unread,
Aug 11, 2016, 7:06:23 AM8/11/16
to Aurelius
did you change the default port? i see you using 8183? i thought it was 8182. did it work when berkelydb was configured?

Can someone clarify why it makes sense to have the default titan.sh script start cassandra, elasticsearch and gremlin-server where the latter does not seem to use cassandra but berkeleyje ?

it was a mistake.

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraphs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/0ef026a6-5008-4045-9d7c-f62bc9d49192%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xander Uiterlinden

unread,
Aug 11, 2016, 8:22:11 AM8/11/16
to Aurelius
It did work when the berkeley db was configured. 
You're seeing a different port since I used an ssh tunneled port from localhost to the remote server.

-- Xander


On Thursday, August 11, 2016 at 1:06:23 PM UTC+2, stephen mallette wrote:
did you change the default port? i see you using 8183? i thought it was 8182. did it work when berkelydb was configured?

Can someone clarify why it makes sense to have the default titan.sh script start cassandra, elasticsearch and gremlin-server where the latter does not seem to use cassandra but berkeleyje ?

it was a mistake.
On Thu, Aug 11, 2016 at 2:52 AM, Xander Uiterlinden <xander.ui...@gmail.com> wrote:
Hi,

I'm trying to get the gremlin-server to work. I did the following:

1. Download and unzip titan-1.0.0-hadoop1.zip

When cd'ing into bin and running titan.sh I can successfully connect to the gremlin server and interact with the graph.

Looking at the gremlin-server config however I noticed it's configured to use berkeleyje. I wanted the gremlin server to work with cassandra, so I modified the gremlin-server.yaml config file to point to the titan-cassandra-es.properties configuration file. When I start the server everything seems fine, but I cannot successfully use it with the gremlin console.

gremlin> :remote connect tinkerpop.server ../conf/remote.yaml

==>Connected - localhost/127.0.0.1:8183

gremlin> :> g.V().count()

Host did not respond in a timely fashion - check the server status and submit again.


What am I missing here ?


Can someone clarify why it makes sense to have the default titan.sh script start cassandra, elasticsearch and gremlin-server where the latter does not seem to use cassandra but berkeleyje ?


Thanks,


Xander

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.

Jason Plurad

unread,
Aug 11, 2016, 10:09:55 AM8/11/16
to Aurelius
Xander, can you share your config files (gremlin-server.yaml, titan-cassandra-es.properties, and remote.yaml)? Did you try connecting with the direct port 8182 instead of the ssh tunneled port?

-- Jason

Xander Uiterlinden

unread,
Aug 12, 2016, 10:08:02 AM8/12/16
to Aurelius
Sure.

gremlin-server.conf

host: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: conf/gremlin-server/titan-cassandra-es.properties}
plugins:
  - aurelius.titan
scriptEngines: {
  gremlin-groovy: {
    imports: [java.lang.Math],
    staticImports: [java.lang.Math.PI],
    scripts: [scripts/empty-sample.groovy]},
  nashorn: {
      imports: [java.lang.Math],
      staticImports: [java.lang.Math.PI]}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { useMapperFromGraph: graph }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { useMapperFromGraph: graph }}
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
threadPoolBoss: 1
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferHighWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
  enabled: false}

titan-cassandra-es.properties
# Titan configuration sample: Cassandra & Elasticsearch over sockets
#
# This file connects to Cassandra and Elasticsearch services running
# on localhost over the Thrift API and the Elasticsearch native
# "Transport" API on their respective default ports.  The Cassandra
# and Elasticsearch services must already be running before starting
# Titan with this file.

# The primary persistence provider used by Titan.  This is required.  It
# should be set one of Titan's built-in shorthand names for its standard
# storage backends (shorthands: berkeleyje, cassandrathrift, cassandra,
# astyanax, embeddedcassandra, hbase, inmemory) or to the full package and
# classname of a custom/third-party StoreManager implementation.
#
# Default:    (no default value)
# Data Type:  String
# Mutability: LOCAL
storage.backend=cassandra

# The hostname or comma-separated list of hostnames of storage backend
# servers.  This is only applicable to some storage backends, such as
# cassandra and hbase.
#
# Default:    127.0.0.1
# Data Type:  class java.lang.String[]
# Mutability: LOCAL
storage.hostname=127.0.0.1

# Whether to enable Titan's database-level cache, which is shared across
# all transactions. Enabling this option speeds up traversals by holding
# hot graph elements in memory, but also increases the likelihood of
# reading stale data.  Disabling it forces each transaction to
# independently fetch graph elements from storage before reading/writing
# them.
#
# Default:    false
# Data Type:  Boolean
# Mutability: MASKABLE
cache.db-cache = true

# How long, in milliseconds, database-level cache will keep entries after
# flushing them.  This option is only useful on distributed storage
# backends that are capable of acknowledging writes without necessarily
# making them immediately visible.
#
# Default:    50
# Data Type:  Integer
# Mutability: GLOBAL_OFFLINE
#
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's
# storage backend.  After starting the database for the first time, this
# file's copy of this setting is ignored.  Use Titan's Management System
# to read or modify this value after bootstrapping.
cache.db-cache-clean-wait = 20

# Default expiration time, in milliseconds, for entries in the
# database-level cache. Entries are evicted when they reach this age even
# if the cache has room to spare. Set to 0 to disable expiration (cache
# entries live forever or until memory pressure triggers eviction when set
# to 0).
#
# Default:    10000
# Data Type:  Long
# Mutability: GLOBAL_OFFLINE
#
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's
# storage backend.  After starting the database for the first time, this
# file's copy of this setting is ignored.  Use Titan's Management System
# to read or modify this value after bootstrapping.
cache.db-cache-time = 180000

# Size of Titan's database level cache.  Values between 0 and 1 are
# interpreted as a percentage of VM heap, while larger values are
# interpreted as an absolute size in bytes.
#
# Default:    0.3
# Data Type:  Double
# Mutability: MASKABLE
cache.db-cache-size = 0.25

# Connect to an already-running ES instance on localhost

# The indexing backend used to extend and optimize Titan's query
# functionality. This setting is optional.  Titan can use multiple
# heterogeneous index backends.  Hence, this option can appear more than
# once, so long as the user-defined name between "index" and "backend" is
# unique among appearances.Similar to the storage backend, this should be
# set to one of Titan's built-in shorthand names for its standard index
# backends (shorthands: lucene, elasticsearch, es, solr) or to the full
# package and classname of a custom/third-party IndexProvider
# implementation.
#
# Default:    elasticsearch
# Data Type:  String
# Mutability: GLOBAL_OFFLINE
#
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's
# storage backend.  After starting the database for the first time, this
# file's copy of this setting is ignored.  Use Titan's Management System
# to read or modify this value after bootstrapping.
index.search.backend=elasticsearch

# The hostname or comma-separated list of hostnames of index backend
# servers.  This is only applicable to some index backends, such as
# elasticsearch and solr.
#
# Default:    127.0.0.1
# Data Type:  class java.lang.String[]
# Mutability: MASKABLE
index.search.hostname=127.0.0.1

# The Elasticsearch node.client option is set to this boolean value, and
# the Elasticsearch node.data option is set to the negation of this value.
# True creates a thin client which holds no data.  False creates a regular
# Elasticsearch cluster node that may store data.
#
# Default:    true
# Data Type:  Boolean
# Mutability: GLOBAL_OFFLINE
#
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's
# storage backend.  After starting the database for the first time, this
# file's copy of this setting is ignored.  Use Titan's Management System
# to read or modify this value after bootstrapping.
index.search.elasticsearch.client-only=true

# Or start ES inside the Titan JVM
#index.search.backend=elasticsearch
#index.search.directory=../db/es
#index.search.elasticsearch.client-only=false
#index.search.elasticsearch.local-mode=true

remote.yaml
hosts: [localhost]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}

-- Xander

Leifur Halldor Asgeirsson

unread,
Aug 12, 2016, 12:30:36 PM8/12/16
to Aurelius

If you check log/gremlin-server.log, I suspect you might find a line that looks something like:
 

349  [main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/gremlin-server/titan-cassandra-es-server.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: Configuration must contain a valid 'gremlin.graph' setting

 

Try adding the line:


    gremlin.graph=com.thinkaurelius.titan.core.TitanFactory

To titan-cassandra-es.properties.

Hope that helps,

Leifur


Xander Uiterlinden

unread,
Aug 15, 2016, 2:29:24 AM8/15/16
to Aurelius
Thanks, that works!

-- Xander
Reply all
Reply to author
Forward
0 new messages