赫克托测试的例子不工作在卡桑德拉0.7.4



我已经设置了我的单节点Cassandra 0.7.4并启动了服务bin/卡桑德拉- f。现在我正在尝试使用Hector API (v. 0.7.0)来管理DB。Cassandra CLI工作得很好,我可以创建键空间等等。

我尝试运行测试示例并创建单个键空间:

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

但是我得到的是:

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

你能告诉我我做错了什么吗?由于

当您通过CLI连接时,是否指定"-h localhost -p 9160"?

你真的可以用上面的命令行做一些事情吗?

来自HThriftClient的错误表明它无法连接到Cassandra守护进程。

FTR,您可以通过hector-users@googlegroups.com

更快地获得响应

如果您在linux机器上,尝试使用以下命令启动cassandra服务器:

/bin$ ./cassandra start -f 

对于cli,使用以下命令:

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

最新更新