本文介绍了GraphFactory消息:GraphFactory无法实例化此Graph实现[com.thinkaurelius.titan.core.TitanFactory]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过gremlin-shell向Cassandra后端(本地或远程)进行图形查询。

I'm trying to make graph queries via a gremlin-shell to a Cassandra backend (locally or remotely).

我下载了一个股票Gremlin Server发行版,然后安装了Titan(如手册安装中所述)。

I downloaded a stock Gremlin Server distribution and then installed Titan (as described here in the manual-installation).

我添加了所有属性设置和类路径:

I added all the property settings and 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

当我启动Gremlin服务器时,我得到以下错误(即使gremlin服务器本身出现):

When I bring up the Gremlin server, I get the following errors (even though gremlin server itself comes up) :

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调用一个简单的图形操作,我看到如下:

Furthermore, when I try to invoke a simple graph operation via the gremlin-shell, I see the following :

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


推荐答案

您应该下载并使用,并确保您参考的Titan 1.0.0 的文档。您不需要单独安装Gremlin Server,因为它已经与Titan 1.0.0发行版捆绑在一起。

You should download and use Titan 1.0.0, and make sure that you refer to the Titan 1.0.0 documentation for Titan Server. You don't need to install Gremlin Server separately because it is already bundled with the Titan 1.0.0 distribution.

Titan 1.0.0版本中有一个错误已。您可以在此之前的上了解详情。简而言之,您需要更新 gremlin-server.yaml 以指向新的配置文件 titan-cassandra-es-server.properties

There was a bug in the Titan 1.0.0 release that has been fixed. You can read more about it on this previous StackOverflow question. In short, you need to update the gremlin-server.yaml to point at a new configuration file titan-cassandra-es-server.properties.

如果您有兴趣将Gremlin Server连接到Titan(而不是使用Titan distrubtion中已经包含的服务器)此中的一些步骤:

If you're interested in connecting Gremlin Server to Titan (rather than using the server already included with the Titan distrubtion), I've listed some steps in this mailing list post:

# Get Apache TinkerPop's Gremlin Server (Titan 1.0.0 uses TinkerPop 3.0.1)
unzip apache-gremlin-server-3.0.1-incubating-bin.zip
cd apache-gremlin-server-3.0.1-incubating

# This will install Titan-Cassandra as a plugin under ext/titan-cassandra
./bin/gremlin-server.sh -i com.thinkaurelius.titan titan-cassandra 1.0.0

# Copy over some Titan configuration files
# https://gist.github.com/pluradj/8437255e831d2b640b6fea4f815a79c5
# * conf/titan-server.yaml
# * conf/titan-cassandra.properties

# start the server with Titan configuration
./bin/gremlin-server.sh conf/titan-server.yaml

这篇关于GraphFactory消息:GraphFactory无法实例化此Graph实现[com.thinkaurelius.titan.core.TitanFactory]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 05:32