首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >dse 4.7中奇怪的DSE单元集成

dse 4.7中奇怪的DSE单元集成
EN

Stack Overflow用户
提问于 2015-06-12 10:30:26
回答 1查看 97关注 0票数 0

我试图对现有的C*表运行Hive查询。

下面是我的C*表定义:

代码语言:javascript
复制
drop table IF  EXISTS mydata.site_users;
CREATE TABLE IF NOT EXISTS appdata.site_users (
        user_id         text,
        user_test_uuid  uuid, --for testing purposes, if we can use it in queries, there could be some serde problems?
        user_name       text,
        PRIMARY KEY (user_id)
        );

以下是我的外部蜂巢表定义:

代码语言:javascript
复制
CREATE EXTERNAL TABLE c_site_users(
        user_id string, user_test_uuid binary, user_name string)
        STORED BY 'org.apache.hadoop.hive.cassandra.cql3.CqlStorageHandler'
        WITH SERDEPROPERTIES( "cassandra.ks.name" = "mydata",
        "cassandra.cf.name" = "site_users",
        "cql3.partition.key" = "user_id",
        "cassandra.cql3.type" = "text, uuid, text"
      );

我使用cqlsh将数据插入到C*表中:

代码语言:javascript
复制
cqlsh:appdata> select * from site_users;

 user_id | user_name | user_test_uuid
---------+-----------+--------------------------------------
   user2 |      Ivan | 51569760-10e6-11e5-af86-23fdaf275fb9
   user1 |    Sergey | 51542660-10e6-11e5-af86-23fdaf275fb9
   user3 |     Johan | 5157a8d0-10e6-11e5-af86-23fdaf275fb9

(3 rows)

现在,我尝试使用dse hive运行相同的查询。

代码语言:javascript
复制
vagrant@dsenode01:~$ dse hive

Logging initialized using configuration in file:/etc/dse/hive/hive-log4j.properties
hive> select * from c_site_users;
OK
Failed with exception java.io.IOException:java.io.IOException: com.datastax.driver.core.exceptions.UnavailableException: Not enough replica available for query at consistency LOCAL_ONE (1 required but only 0 alive)
Time taken: 13.297 seconds

太奇怪了!C*表是可以的,数据在那里,我可以查询它,但是dse单元会抱怨。我做错什么了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-12 15:22:45

好吧,答案很简单。我需要在每个节点上启用hadoop运行dse。我有3个节点和RF=1,只有一个节点启用了HADOOP。我在所有3个节点上都打开了HADOOP,它从两个方面工作: C*表支持的查询外部表和C*表,因为DSE隐式地用C*表更新转移。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30800857

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档