我已經設置了我的單節點Cassandra 0.7.4,並使用 bin/cassandra -f啓動了服務。現在我正在嘗試使用Hector API(v。0.7.0)來管理 數據庫。 Cassandra CLI工作正常,我可以創建密鑰空間等。Hector測試示例不適用於Cassandra 0.7.4
我試着運行測試例子,創建一個單一的密鑰空間:
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一起工作的原因。是的,我確實在CLI中指定了主機和端口(connect localhost/9160; 連接到:localhost/9160上的「Test Cluster」)。 – AndaP 2011-04-16 11:08:12