cp conf/gremlin-server/gremlin-server.yaml conf/rest-gremlin-server.yaml
cp conf/titan-cassandra.properties conf/gremlin-server/titan-cassandra-server.properties
host: 0.0.0.0
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
graph: conf/gremlin-server/titan-cassandra-server.properties}
storage.hostname=127.0.0.1
storage.cassandra.keyspace=TITAN_DEMO
curl -XPOST -Hcontent-type:application/json -d '{"gremlin":"g.V().count()"}' http://localhost:8182
./bin/gremlin-server.sh ./conf/gremlin-server/rest-gremlin-server.yaml
Hi Jason,
I’m following your steps to start the Gremlin Server REST service, with successfully configured Gremlin Server with HBase storage backend. But I confronted 400 Error when testing REST API with curl:
$ curl -v -XPOST -Hcontent-type:application/json -d '{"gremlin":"g.V().count()"}' http://localhost:8182
* About to connect() to localhost port 8182 (#0)
* Trying 127.0.0.1... connected
> POST / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8182
> Accept: */*
> content-type:application/json
> Content-Length: 27
>
* upload completely sent off: 27out of 27 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection #0
{"message":"no serializer for requested Accept header: */*"}
also tried other inputs from TK3 Doc, resulting the same error in response. Then I figured may be I should specify the Accept header to Accept: application/json, only to find {"message":"no serializer for requested Accept header: application/json"}.
BR,
Todd Leo
curl -v -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"gremlin":"g.V().count()"}' http://localhost:8182
Hi Jason,
Thanks for the respond. Sadly, explicit parameter for Accept doesn’t work either:
$ curl -v -XPOST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"gremlin":"g.V().count()"}' http://localhost:8182
{"message":"no serializer for requested Accept header: application/json"}
BR,
Todd Leo
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/b27ae22c-0f14-4c09-8280-3b241def5410%40googlegroups.com.--
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.
Hi Stephen,
I’m not particularly familiar with the setting of gremlin server. Did you mean using ioRegistries instead of useMapperFromGraph, like the following(imagine I have 2 graphs configured, graph1 and graph2):
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph1 }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph2 }}
#...other serializers, GraphSONMessageSerializerGremlinV1d0, GraphSONMessageSerializerV1d0
and, is this property a requirement for each graph instance? What if I don’t set useMapperFromGraph nor ioRegistries?
BR,
Todd Leo
You received this message because you are subscribed to a topic in the Google Groups "Aurelius" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aureliusgraphs/v4UcYwE5UVU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/CAA-H43-0ZeL03K%3DaL3D1k25tW%2B618bgnWCCLHgMUbjDuN3J74w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/CAD_PBkRwg%2Bqt%3DrM_4GnPWJTiSx280eVYZAv4vdh7tbr2vZUJjA%40mail.gmail.com.
{ "message": "no serializer for requested Accept header: application/json"}# 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: LOCALstorage.backend=cassandrathrift
# 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: LOCALstorage.hostname=127.0.0.1
storage.directory=/home/kevin/databases
#storage.cassandra.keyspace=TITAN_DEMO# 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: MASKABLEcache.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=truehost: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
serializedResponseTimeout: 30000
#channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
#graph: conf/gremlin-server/titan-berkeleyje-server.properties}
#graph: conf/gremlin-server/titan-cassandra-es-server.properties}
graph: conf/freeth.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}gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
...