简体   繁体   English

无法从Titan连接到远程Cassandra

[英]Unable to connect to remote cassandra from titan

I am using cassandra 2.0.7 sitting on a remote server listening on non-default port 我正在坐在远程服务器上的cassandra 2.0.7上侦听非默认端口

<code>
---cassandra.yaml
rpc_address: 0.0.0.0
rpc_port: 6543
</code>

I am trying to connect to the server using titan-0.4.4 (java API, also tried with rexster) using the following config: 我正在尝试使用以下配置使用titan-0.4.4(java API,也尝试过rexster)连接到服务器:

<code>
storage.hostname=172.182.183.215
storage.backend=cassandra
storage.port=6543
storage.keyspace=abccorp
</code>

It does not connect and I see the the following exceptions below. 它没有连接,我在下面看到以下异常。 However, if I use cqlsh on the same host from where I am trying to execute my code/rexster, I am able to connect without any issues. 但是,如果我在尝试执行代码/ rexster的同一主机上使用cqlsh,则可以连接而没有任何问题。 Anybody seen this? 有人看到吗?

<code>
0    [main] INFO  com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager  - Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,name=ClusterTitanConnectionPool,ServiceType=connectionpool
49   [main] INFO  com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor  - AddHost: 172.182.183.215
554  [main] INFO  com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager  - Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,name=KeyspaceTitanConnectionPool,ServiceType=connectionpool
555  [main] INFO  com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor  - AddHost: 172.182.183.215
999  [main] INFO  com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor  - AddHost: 127.0.0.1
1000 [main] INFO  com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor  - RemoveHost: 172.182.183.215
2366 [main] INFO  com.thinkaurelius.titan.diskstorage.Backend  - Initiated backend operations thread pool of size 16
41523 [RingDescribeAutoDiscovery] WARN  com.netflix.astyanax.impl.RingDescribeHostSupplier  - Failed to get hosts from abccorp via ring describe.  Will use previously known ring instead
61522 [RingDescribeAutoDiscovery] WARN  com.netflix.astyanax.impl.RingDescribeHostSupplier  - Failed to get hosts from abccorp via ring describe.  Will use previously known ring instead
63080 [main] INFO  com.thinkaurelius.titan.diskstorage.util.BackendOperation  - Temporary storage exception during backend operation. Attempting backoff retry
com.thinkaurelius.titan.diskstorage.TemporaryStorageException: Temporary failure in storage backend
    at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxOrderedKeyColumnValueStore.getNamesSlice(AstyanaxOrderedKeyColumnValueStore.java:138)
    at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxOrderedKeyColumnValueStore.getSlice(AstyanaxOrderedKeyColumnValueStore.java:88)
    at com.thinkaurelius.titan.graphdb.configuration.KCVSConfiguration$1.call(KCVSConfiguration.java:70)
    at com.thinkaurelius.titan.graphdb.configuration.KCVSConfiguration$1.call(KCVSConfiguration.java:64)
    at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:30)
    at com.thinkaurelius.titan.graphdb.configuration.KCVSConfiguration.getConfigurationProperty(KCVSConfiguration.java:64)
    at com.thinkaurelius.titan.diskstorage.Backend.initialize(Backend.java:277)
    at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1174)
    at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.<init>(StandardTitanGraph.java:75)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:40)
    at com.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:29)
    at com.abccorp.grp.graphorm.GraphORM.<init>(GraphORM.java:23)
    at com.abccorp.grp.graphorm.GraphORM.getInstance(GraphORM.java:47)
    at com.abccorp.grp.utils.dataloader.MainLoader.main(MainLoader.java:150)
Caused by: com.netflix.astyanax.connectionpool.exceptions.NoAvailableHostsException: NoAvailableHostsException: [host=None(0.0.0.0):0, latency=0(0), attempts=0]No hosts to borrow from
    at com.netflix.astyanax.connectionpool.impl.RoundRobinExecuteWithFailover.<init>(RoundRobinExecuteWithFailover.java:30)
    at com.netflix.astyanax.connectionpool.impl.TokenAwareConnectionPoolImpl.newExecuteWithFailover(TokenAwareConnectionPoolImpl.java:83)
    at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:256)
    at com.netflix.astyanax.thrift.ThriftColumnFamilyQueryImpl$4.execute(ThriftColumnFamilyQueryImpl.java:519)
    at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxOrderedKeyColumnValueStore.getNamesSlice(AstyanaxOrderedKeyColumnValueStore.java:136)
    ... 13 more
91522 [RingDescribeAutoDiscovery] WARN  com.netflix.astyanax.impl.RingDescribeHostSupplier  - Failed to get hosts from abccorp via ring describe.  Will use previously known ring instead
121522 [RingDescribeAutoDiscovery] WARN  com.netflix.astyanax.impl.RingDescribeHostSupplier  - Failed to get hosts from abccorp via ring describe.  Will use previously known ring instead
</code>

Any help greatly appreciated. 任何帮助,不胜感激。 I am evaluating titan on cassandra and am a bit stuck on this as previously I was using cassandra (same version) on localhost and everything was fine. 我正在对cassandra上的titan进行评估,对此有点卡住,因为以前我在localhost上使用了cassandra(相同版本),一切都很好。

thanks 谢谢

Changing the listen_address to 172.182.183.215 in the configuration had done the trick. 在配置中将listen_address更改为172.182.183.215就可以了。 Initially it was not clear if just setting the rpc_address was enough. 最初尚不清楚仅设置rpc_address是否足够。

Thrift and the drivers that support Thrift are deprecated as of C* 1.2. 从C * 1.2开始,不建议使用Thrift和支持Thrift的驱动程序。 You should switch to the DataStax Java Driver (currently at 2.0.2). 您应该切换到DataStax Java驱动程序(当前为2.0.2)。

Alternately, ensure this is set properly in cassandra.yaml start_rpc: true 或者,确保在cassandra.yaml start_rpc中正确设置了此设置:true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM