将Titan连接到Solr [英] Connecting Titan To Solr
问题描述
我正在尝试将titan连接到solr.我正在使用的属性文件是 titan-cassandra-solr.properties
:
I am trying to connect titan to solr. The properties file I am using is titan-cassandra-solr.properties
:
index.search.backend=solr
index.search.solr.mode=cloud
index.search.solr.zookeeper-url=localhost:2181
我已将我的泰坦核心配置为:
I have configured my titan core to be:
名称: titan
实例: /opt/solr-titan/titan
数据:/opt/solr-titan/data
我有一个 conf
目录,其中包含我从 titandb/conf/solr
.
inside /opt/solr-titan/titan
I have a conf
directory which contains all the files I copied from titandb/conf/solr
.
当我使用 gremlin.sh
并尝试:
gremlin> graph = TitanFactory.open("conf/titan-cassandra-solr.properties")
==>standardtitangraph[cassandrathrift:[127.0.0.1]]
gremlin> graph.traversal().V()
==>v[4328]
gremlin> graph.traversal().V().has("MY_ID", "www.mindmaps.com/action-movie")
==>v[4328]
gremlin> graph.traversal().V().has("MY_ID", "action-movie")
gremlin> graph.traversal().V().has("MY_ID", "www.mindmaps.com/action-movie")
==>v[4328]
一切似乎都在起作用,但是当我运行时:
it all seems to be working but when I run:
TitanGraph titanGraph = TitanFactory.open("conf/titan-cassandra-solr.properties");
我收到以下异常:
6:02:51,191 INFO ClientCnxn:975 - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
16:02:51,212 WARN ClientCnxn:1102 - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
推荐答案
通过执行以下操作,我设法使titan与solr交谈:
I managed to get titan to talk to solr by doing the following:
更改我的Solr核心.我通过使用 solr start -e schemaless
简单运行了solr,然后更改了 titan-cassandra-solr.properties
成为:
Change my solr core. I simple ran solr by using solr start -e schemaless
then I changed titan-cassandra-solr.properties
to be:
index.search.backend=solr
index.search.solr.mode=http
index.search.solr.zookeeper-url=http://localhost:8983/solr
清洁Titan.运行 titan.sh stop
,然后运行 titan.sh clean
此后,我能够通过我的Java代码连接到Titan.我仍然需要做更多的工作才能获得这种工作的云模式,但目前看来,这是可行的.
After this I was able to connect to Titan through my java code. I still need do more to get this working cloud mode but for now this seems to work.
这篇关于将Titan连接到Solr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!