Gremlin 小精灵不';连接到cassandra时无法启动

Gremlin 小精灵不';连接到cassandra时无法启动,gremlin,Gremlin,我的Titan 1.0.0和cassandra 2.1.2安装程序在linux中运行良好。当我开始使用我的小精灵时 ./gremlin.sh ../conf/gremlin-server/gremlin-server-cassandra-es.yaml 我得到以下错误: \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: aurelius.titan plugin activated: tinkerpop.server

我的Titan 1.0.0和cassandra 2.1.2安装程序在linux中运行良好。当我开始使用我的小精灵时

./gremlin.sh ../conf/gremlin-server/gremlin-server-cassandra-es.yaml
我得到以下错误:

     \,,,/
     (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/ec2-user/titan/titan-1.0.0-  hadoop1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/ec2-user/titan/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]
log4j:WARN No appenders could be found for logger (org.apache.hadoop.security.Groups).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.tinkergraph
==>10.253.11.125
==>8182
==>1
==>8
==>30000
==>30000
Exception in thread "main" groovy.lang.MissingPropertyException: No such property: com for class: groovysh_evaluate
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:51)
    at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:304)
    at groovysh_evaluate.run(groovysh_evaluate:3)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:69)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:185)
    at org.apache.tinkerpop.gremlin.console.Console.initializeShellWithScript(Console.groovy:290)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:141)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:303)
它运行,但显示了一些错误

     \,,,/
     (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/ec2-user/titan/titan-1.0.0-hadoop1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/ec2-user/titan/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]
log4j:WARN No appenders could be found for logger (org.apache.hadoop.security.Groups).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
plugin activated: tinkerpop.hadoop
plugin activated: tinkerpop.tinkergraph
gremlin>

我希望它连接到cassandra,所以我希望第一个命令能够工作。我不理解这里的问题。

您正在启动Gremlin控制台,并告诉它加载并执行
.yaml
文件的内容,因为它不是Groovy文件,所以无法工作。使用
/gremlin.sh
运行应该可以做到这一点,但是

。。。您似乎是从
/bin
文件夹而不是从Titan root
/
文件夹启动Titan和Gremlin控制台。转到Titan根文件夹,尝试使用以下命令启动Titan和控制台:

bin/titan.sh start
bin/gremlin.sh
如果您没有更改任何配置文件,那么在默认的Titan v1.0.0安装中,这应该是现成的。要进行更多故障排除,请在详细模式下启动Titan,方法是:

bin/titan.sh start -v

为了跟进您的评论,您似乎开始使用Titan(和TinkerPop),并混合了其中的一些核心概念。您当前正在尝试配置相当高级的设置。我建议先熟悉TinkerPop和TinkerGraph(内存图)。一旦您熟悉了这一点,您就可以尝试使用Titan,首先是使用嵌入式Cassandra的单机设置(默认设置),然后是远程Cassandra设置(您正在尝试实现)。

如果我理解正确,您可以尝试使用Cassandra作为存储后端启动Gremlin server(?)在本例中,请尝试

$ path/to/gremlin-server.sh path/to/your/gremlin-server-cassandra-es.yaml
在另一个终端中,您可以使用

$ path/to/your/gremlin.sh
然后您可以连接到gremlin服务器:

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

如前所述,在第一个示例中,您启动了Gremlin客户端,并将Gremlin服务器的配置传递给它。

您误用了Gremlin控制台
/gremlin.sh../conf/gremlin server/gremlin server cassandra es.yaml
尝试执行该文件的内容,但由于它是一个yaml文件(请参见)。我正在尝试通过gremlin连接到后端cassandra。我对cassandra.yaml文件做了一些更改[–seeds:“127.0.0.1”到–seeds:“192.168.14.129”侦听地址:127.0.0.1到侦听地址:192.168.14.129 rpc_地址:127.0.0.1到rpc_地址:192.168.14.129]。我试着启动gremlin,我得到了同样的错误。你能分享一下我可以使用cassandra作为后端的步骤吗。在您的情况下,没有使用后端。我想将它与cassandra连接起来。在创建一个图时,使用g=TinkerGraphFactory.CreateTinkergraphy(),在运行./gremlin.sh之后,我得到groovy.lang.MissingPropertyException:没有这样的属性:TinkerGraphFactory for class:groovysh_在org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap上求值(ScriptBytecodeAdapter.java:51)在org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)在org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:304)在groovysh_evaluate.run(groovysh_evaluate:3)你很可能在寻找
graph=TitanFactory.open('conf/titan cassandra es.properties');g=graph.traversal();
仔细观察。您正在键入
g=TinkerGraphFactory.createTinkergraphy(…)
。titan使用
g=TitanFactory.open(…)
。请仔细观察:)
Titan
与TinkerGraph不同。是的,正确!!!但是,我尝试了path/to/gremlin-server.sh path/to/your/gremlin-server-cassandra-es.yaml,得到了上述错误。所以我被困在那里,在运行./gremlin.sh之后,我还尝试了graph=TitanFactory.open('conf/titan cassandra es.properties'),这导致,
gremlin>graph=TitanFactory.open('conf/titan cassandra es.properties'))16:01:26WARNcom.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration-本地设置index.search.elasticsearch.Local mode=true(Type:GLOBAL_OFFLINE)被全局管理值(false)覆盖。使用ManagementSystem界面而不是本地配置来控制此设置。无法实例化实现:com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex
您可能必须从头开始。关闭Titan(
bin/Titan.sh stop
),然后删除数据(
rm-rf db
,假设您可以永久删除所有内容),然后再次启动Titan(
bin/Titan.sh start
),然后启动控制台(
bin/gremin.sh
)。我仍然强烈建议你在使用泰坦之前更熟悉TinkerPop。我已经设置了我的cassandra和Titan运行。而且小精灵也很好用。我使用,
gremlin>conf=newbaseconfiguration()将gremlin连接到cassandra;gremlin>conf.setProperty('storage.backend','cassandra');gremlin>conf.setProperty('storage.hostname','192.168.14.129');gremlin>conf.setProperty('storage.keyspace','test');gremlin>g=TitanFactory.open(conf)gremlin>v1=g.addVertex(标签,“person”、“f_name”、“Anna”);=>v[8424]
如何检查此数据是否在测试键空间(已在cassandra中)中输入到cassandra?一个小细节:最好命名TitanGraph
graph
而不是
g
。大多数示例和教程使用
g
作为遍历的符号。为图形命名
g
可能会导致以后的混淆。我不确定是否理解您的问题:是否要检索刚刚添加的顶点?
 gremlin> :remote connect tinkerpop.server path/to/gremlin/conf/remote.yaml