Astyanax 1.56.37 连接到在 Debian 上运行的 Cassandra 1.2.6:
在对仅包含一个位于 10.10.1.141 的节点的 Cassandra 集群执行快速连续插入时,在看似随机的点上,我将在控制台中看到以下内容:
- AddHost: 127.0.0.1
- RemoveHost: 10.10.1.141
在我收到此信息后,每次尝试连接到此键空间都会失败并显示相同的消息。
这是我的配置:
AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
.forCluster("Titan Cluster")
.forKeyspace(keyspaceName)
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
.setTargetCassandraVersion("1.2")
)
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(9160)
.setMaxConnsPerHost(50)
.setSeeds("10.10.1.141:9160")
.setConnectTimeout(2000)
.setSocketTimeout(30000)
.setMaxTimeoutWhenExhausted(10000)
.setMaxTimeoutCount(3)
.setTimeoutWindow(10000)
.setLatencyAwareBadnessThreshold(10)
.setLatencyAwareUpdateInterval(1000)
.setLatencyAwareResetInterval(10000)
.setLatencyAwareWindowSize(100)
)
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
.buildKeyspace(ThriftFamilyFactory.getInstance());
context.start();
后续尝试连接失败context.start()