我正在嘗試通過gremlin-shell將圖形查詢映射到Cassandra後端(本地或遠程)。GraphFactory消息:GraphFactory無法實例化此圖形實現[com.thinkaurelius.titan.core.TitanFactory]
我下載了股票Gremlin服務器分佈,然後安裝泰坦(如手動安裝中所述)。
http://s3.thinkaurelius.com/docs/titan/0.9.0-M1/server.html
我添加的所有屬性設置和CLASSPATH:
~/gremlin-server-3.0.0.M6$ cat conf/titan-cassandra.properties
gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
storage.backend=cassandrathrift
storage.directory=../db/cassandra
~/gremlin-server-3.0.0.M6$ cat conf/gremlin-server.yaml
host: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
serializedResponseTimeout: 30000
channelizer: com.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
g: conf/titan-cassandra.properties}
#g: conf/tinkergraph-empty.properties}
plugins:
- aurelius.titan
當我調出小鬼服務器,我收到以下錯誤(即使小鬼服務器本身出現):
bin/gremlin-server.sh
[INFO] GremlinServer -
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server.yaml
[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
[INFO] MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=com.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[WARN] Graphs - Graph [g] configured at [conf/titan-cassandra.properties] could not be instantiated and will not be available in Gremlin Server. GraphFactory message: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]
:
:
[INFO] GremlinServer - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
[INFO] ScriptEngines - Loaded nashorn ScriptEngine
[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
[INFO] GremlinServer - Initialized GremlinExecutor and configured ScriptEngines.
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+kryo with com.tinkerpop.gremlin.driver.ser.KryoMessageSerializerV1d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+kryo-stringd with com.tinkerpop.gremlin.driver.ser.KryoMessageSerializerV1d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with com.tinkerpop.gremlin.driver.ser.JsonMessageSerializerGremlinV1d0
[INFO] AbstractChannelizer - Configured application/json with com.tinkerpop.gremlin.driver.ser.JsonMessageSerializerV1d0
[INFO] GremlinServer - Gremlin Server configured with worker thread pool of 1 and boss thread pool of 1
[INFO] GremlinServer - Channel started at port 8182.
此外,當我嘗試通過gremlin-shell調用簡單的圖形操作時,我看到以下內容:
bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: aurelius.titan
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/appsec/titan-1.0.0-hadoop1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/appsec/titan-1.0.0-hadoop1/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
20:50:02 INFO org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph - HADOOP_GREMLIN_LIBS is set to: /home/appsec/titan-1.0.0-hadoop1/lib
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.tinkergraph
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Connected - localhost/127.0.0.1:8182
gremlin> GraphOfTheGodsFactory.load(graph)
No such property: graph for class: groovysh_evaluate
Display stack trace? [yN] y
groovy.lang.MissingPropertyException: No such property: graph for class: groovysh_evaluate
gremlin> graph = TitanFactory.open('/home/appsec/gremlin-server-3.0.0.M6/conf/titan-cassandra.properties')
Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager
Display stack trace? [yN] y
java.lang.IllegalArgumentException: Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager
:
:
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.thrift.transport.TSocket.open(TSocket.java:180)
... 55 more
順便說一句,我沒有接泰坦從thinkaurelius而不是tinkerpop,根據此鏈接http://stackoverflow.com/questions/32426336/load-titan-graph-with-gremlin – bhuvanrk