Hi all,
I have a multiple data center configuration with Cassandra 1.1.7 (non-datastax version) and am using Astyanax. I would like to make sure that my configuration is correct. Note that I am using a PropertyFileSnitch. I was seeing inconsistent response times and recently changed to NodeDiscoveryType.NONE to ensure traffic was going to the proper nodes as I feared it may be going to the other data center at times. Clients in the data centers make sure to only pass the seeds for Cassandra nodes within that data center. Could you also give an idea of what values you are using for max connections and blocked threads? Thank you so much!
Code snippet:
AstyanaxContext<Cluster> context = new AstyanaxContext.Builder()
.forCluster("Data Store Cluster")
.withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.TOKEN_AWARE)
.setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
.setRetryPolicy(new ExponentialBackoff(
PropertyService.getInt("cassandra.retry.exponential.base.ms",10),
PropertyService.getInt("cassanrda.retry.max.attempts",3)
))
)
.withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(9160)
.setMaxConns(100)
.setMaxConnsPerHost(100)
.setMaxBlockedThreadsPerHost(100)
.setSeeds("datastore.server.com")
)
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor()).buildCluster(ThriftFamilyFactory.getInstance());
