Hector test example not working on Cassandra 0.7.4

712 Views Asked by At

I have set up my single node Cassandra 0.7.4 and started the service with bin/cassandra -f. Now I am trying to use the Hector API (v. 0.7.0) to manage the DB. The Cassandra CLI works fine and I can create keyspaces and so on.

I tried to run the test example and create a single keyspace:

Cluster cluster = HFactory.getOrCreateCluster("TestCluster",
                new CassandraHostConfigurator("localhost:9160"));

Keyspace keyspace = HFactory.createKeyspace("Keyspace1", cluster);

But all I get is this:

2011-04-14 22:20:27,469 [main      ] INFO 
me.prettyprint.cassandra.connection.CassandraHostRetryService  
- Downed Host
Retry service started with queue size -1 and retry delay 10s
2011-04-14 22:20:27,492 [main      ] DEBUG
me.prettyprint.cassandra.connection.HThriftClient  -
 Transport open status false
for client CassandraClient<localhost:9160-1>
....this again about 20 times
me.prettyprint.cassandra.service.JmxMonitor  - Registering JMX
me.prettyprint.cassandra.service_TestCluster:ServiceType=hector,
MonitorType=hector
2011-04-14 22:20:27,636 [Thread-0  ] INFO 
me.prettyprint.cassandra.connection.CassandraHostRetryService  - 
Downed Host
retry shutdown hook called
2011-04-14 22:20:27,646 [Thread-0  ] INFO 
me.prettyprint.cassandra.connection.CassandraHostRetryService  - 
Downed Host
retry shutdown complete

Can you please tell me what I'm doing wrong? Thanks

2

There are 2 best solutions below

1
On

When you connect via the CLI, do you specify "-h localhost -p 9160"?

Can you actually do stuff on the command line with the above?

The error from HThriftClient indicates it could not connect to the Cassandra Daemon.

FTR, you would get responses much faster via [email protected]

0
On

If you are on a linux machine, try starting up your cassandra server by this command:

/bin$ ./cassandra start -f 

Then for the cli, use this command:

./cassandra-cli -h {hostname}/9160.

Then make sure that the configures are ok.