使用 gremlin 加载 Cassandra 时连接被拒绝

Connection Refused while loading Cassandra using gremlin

我正在使用 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.属性:

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

知道我错过了什么吗?

此问题之前已在 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。