gpt4 book ai didi

cassandra - 连接到两个节点集群时出现 astyanax TokenRangeOfflineException

转载 作者:行者123 更新时间:2023-12-03 05:05:33 27 4
gpt4 key购买 nike

我编写了一些相当简单的代码来试验 astyanax。当与本地主机上的单节点 Cassandra 数据库通信时,它工作正常,但是当我将相同的架构写入两节点集群(绝对可以从我的主机访问)时,我得到一个 TokenRangeOfflineException 。 p>

我错过了什么?

AstyanaxContext.Builder builder = new AstyanaxContext.Builder()
.forKeyspace("myKeyspace")
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.NONE)
)
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(9160)
.setMaxConnsPerHost(5)
.setSeeds("host1.domain.com,host2.domain.com")
)
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor());

产生此错误:

Exception in thread "main" com.netflix.astyanax.connectionpool.exceptions.TokenRangeOfflineException: TokenRangeOfflineException: [host=host1.domain.com, latency=59(94), attempts=1]UnavailableException()
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:165)
com.netflix.astyanax.connectionpool.exceptions.TokenRangeOfflineException: TokenRangeOfflineException: [host=host1.domain.com, latency=59(94), attempts=1]UnavailableException()
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:165)
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:60)
at com.netflix.astyanax.thrift.ThriftColumnFamilyQueryImpl$1$2.execute(ThriftColumnFamilyQueryImpl.java:200)
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:60)

最佳答案

关于cassandra - 连接到两个节点集群时出现 astyanax TokenRangeOfflineException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14167592/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com