Hector 测试示例不适用于 Cassandra 0.7.4

发布于 2024-11-01 11:12:51 字数 1271 浏览 0 评论 0原文

我已经设置了单节点 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

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是一片海 2024-11-08 11:12:51

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

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

HThriftClient 的错误表明它无法连接到 Cassandra Daemon。

FTR,您可以通过[电子邮件受保护]更快地获得回复

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]

极致的悲 2024-11-08 11:12:51

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

/bin$ ./cassandra start -f 

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

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

然后确保配置正常。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文