PoolTimeoutException connecting to Cassandra 1.1.12 with Astyanax 1.0.3 Java Client

49 views
Skip to first unread message

Lorena Nicole

unread,
Oct 14, 2014, 3:42:23 PM10/14/14
to astyanax-cas...@googlegroups.com

Following the Astyanax Getting Started Instructions I built an IntelliJ Maven project using the quickstart archetype. Inside the pom.xml Astyanax is listed as a dependency --

    <dependency>
        <groupId>com.netflix.astyanax</groupId>
        <artifactId>astyanax</artifactId>
        <version>1.0.3</version>
    </dependency>

And inside of cassandra.yaml the rpc_address is set to localhost and rpc_port to 9160.

The Cassandra class itself --

public class CassandraConnector {

  public static void main(String[] args) throws ConnectionException {

    AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
            .forCluster("TestCassandraCluster")
            .forKeyspace("demo")
            .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
                            .setDiscoveryType(NodeDiscoveryType.NONE)
            )
            .withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl("TestCassandraPool")
                            .setPort(9160)
                            .setMaxConnsPerHost(1)
                            .setSeeds("127:0.0.1:9160")
                            .setConnectTimeout(10000)
            )
            .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
            .buildKeyspace(ThriftFamilyFactory.getInstance());

    context.start();
    Keyspace keyspace = context.getEntity();
    System.out.println(keyspace.getKeyspaceName());

    ColumnFamily<String, String> CF_USER_INFO =
            new ColumnFamily<String, String>(
                    "demo",
                    StringSerializer.get(),   
                    StringSerializer.get());  
    OperationResult<ColumnList<String>> result = keyspace.prepareQuery(CF_USER_INFO)
                                                         .getKey("key-name")
                                                         .execute();
  }


}

Every time I compile and run main() I obtain the following error --

Exception in thread "main" com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException: PoolTimeoutException: [host=127:0.0.1(127:0.0.1):9160, latency=10005(10005), attempts=1] Timed out waiting for connection

Thoughts?


Reply all
Reply to author
Forward
0 new messages