我正在使用Cassandra和TitanDB完成我的第一步。 我安装了cassandra,它正在运行:
INFO 14:08:06 Node /127.0.0.1 state jump to NORMAL
INFO 14:08:06 Netty using Java NIO event loop
INFO 14:08:06 Using Netty Version: [netty-buffer=netty-buffer-
INFO 14:08:06 Starting listening for CQL clients on /127.0.0.1:9042
INFO 14:08:06 Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it
INFO 14:08:16 Scheduling approximate time-check task with a precision of 10 milliseconds
:apache-cassandra-3.3 yse$ !netstat
netstat -an | grep 7000
tcp4 0 0 127.0.0.1.7000 *.* LISTEN
现在关于Gremlin:
gremlin> graph = TitanFactory.open('conf/titan-cassandra-es.properties')
Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager
.. 引起:java.net.ConnectException:拒绝连接
CONF / titan-cassandra-es.properties:
storage.backend=cassandrathrift
storage.hostname=127.0.0.1
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.25
index.search.backend=elasticsearch
index.search.directory=/tmp/titan/es
index.search.elasticsearch.client-only=false
index.search.elasticsearch.local-mode=true
知道我错过了什么吗?
答案 0 :(得分:1)
此问题之前已在Titan mailing list上得到解答。 Titan使用Thrift与Cassandra进行通信,Thrift在Cassandra 2.2及更高版本上默认禁用。一些选项是:
- 在启动Cassandra节点之前更新$CASSANDRA_HOME/conf/cassandra.yaml
# Whether to start the thrift rpc server.
start_rpc: true
# port for Thrift to listen for clients on
rpc_port: 9160
- 如果Cassandra节点已在运行,则启用Thift
$CASSANDRA_HOME/bin/nodetool enablethrift
请记住,Titan 1.0.0是针对Cassandra 2.1构建并进行测试的(请参阅Titan version compatibility matrix),因此请谨慎对待Cassandra 3.3。