1

我已经设置了我的单节点 Cassandra 0.7.4 并使用 bin/cassandra -f 启动了该服务。现在我正在尝试使用 Hector API (v. 0.7.0) 来管理数据库。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

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

4

2 回答 2

1

通过 CLI 连接时,是否指定“-h localhost -p 9160”?

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

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

FTR,您可以通过 hector-users@googlegroups.com 更快地获得响应

于 2011-04-15T20:06:37.433 回答
0

如果您使用的是 linux 机器,请尝试通过以下命令启动您的 cassandra 服务器:

/bin$ ./cassandra start -f 

然后对于 cli,使用以下命令:

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

然后确保配置正常。

于 2014-07-01T13:23:25.663 回答