泰坦无法连接到卡桑德拉

时间:2017-07-17 04:51:02

标签: cassandra titan

enter image description here

我正在尝试使用以下代码将Tital连接到此Cassandra:

    TitanGraph graph = TitanFactory.build()
            .set("storage.backend","cassandra")
            .set("storage.hostname","127.0.0.1")
            .open();

但是,我收到错误

  

线程“main”中的异常java.lang.IllegalArgumentException:可以   没有实例化实现:   com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager     在   com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:55)     在   com.thinkaurelius.titan.diskstorage.Backend.getImplementationClass(Backend.java:473)     在   com.thinkaurelius.titan.diskstorage.Backend.getStorageManager(Backend.java:407)     在   com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration。(GraphDatabaseConfiguration.java:1320)     在   com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)     在   com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:84)     在   com.thinkaurelius.titan.core.TitanFactory $ Builder.open(TitanFactory.java:139)     在com.txtstreet.bucket.TitanExample.main(TitanExample.java:59)   引起:java.lang.reflect.InvocationTargetException at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)     在   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在   com.thinkaurelius.titan.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:44)     ... 7更多引起:   com.thinkaurelius.titan.diskstorage.TemporaryBackendException:   存储后端的临时故障   com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.ensureKeyspaceExists(AstyanaxStoreManager.java:572)     在   com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager。(AstyanaxStoreManager.java:291)     ... 12更多引起:   com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException:   PoolTimeoutException:[host = 127.0.0.1(127.0.0.1):9160,   latency = 10003(10003),attempts = 1]等待连接超时   com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.waitForConnection(SimpleHostConnectionPool.java:231)     在   com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.borrowConnection(SimpleHostConnectionPool.java:198)     在   com.netflix.astyanax.connectionpool.impl.RoundRobinExecuteWithFailover.borrowConnection(RoundRobinExecuteWithFailover.java:84)     在   com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:117)     在   com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:352)     在   com.netflix.astyanax.thrift.ThriftClusterImpl.executeSchemaChangeOperation(ThriftClusterImpl.java:146)     在   com.netflix.astyanax.thrift.ThriftClusterImpl.internalCreateKeyspace(ThriftClusterImpl.java:321)     在   com.netflix.astyanax.thrift.ThriftClusterImpl.addKeyspace(ThriftClusterImpl.java:294)     在   com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager.ensureKeyspaceExists(AstyanaxStoreManager.java:567)     ......还有13个

1 个答案:

答案 0 :(得分:0)

启用Cassandra的Thrift服务器

使用以下命令启用thrift

nodetool enablethrift