【问题标题】:Hector test example not working on Cassandra 0.7.4Hector 测试示例不适用于 Cassandra 0.7.4
【发布时间】:2011-08-06 03:28:18
【问题描述】:

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

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

【问题讨论】:

    标签: nosql cassandra cassandra-0.7


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 我认为错误是由于未连接到守护程序,这就是为什么我觉得它与 CLI 一起工作很奇怪。是的,我确实在 CLI 中指定了主机和端口(连接 localhost/9160;连接到:localhost/9160 上的“测试集群”)。
    【解决方案2】:

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

    /bin$ ./cassandra start -f 
    

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

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

    然后确保配置没问题。

    【讨论】:

      猜你喜欢
      • 2023-04-02
      • 2012-03-12
      • 1970-01-01
      • 2020-12-16
      • 1970-01-01
      • 2011-12-26
      • 2015-06-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多