2015-06-12 25 views
0

我试图在现有的C *表上运行Hive查询。DSE中奇怪的dse配置单元集成4.7

这里是我的C *表定义:

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" 
    ); 

我插入的数据转换成C *表使用cqlsh:

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) 
是我的外部蜂巢表定义

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) 
     ); 

这里

现在我尝试运行相同的查询使用dse配置单元

[email protected]:~$ 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配置单元抱怨。我做错了什么?

回答

1

好的,所以答案很简单。我需要在每个节点上启用hadoop启用dse。我有3个节点,RF = 1。只有一个节点启用了HADOOP。我在所有3个节点上都打开了HADOOP,并且它从两个方面都起作用:由于DSE使用C *表隐式更新Metastore,因此直接查询由C *表和C *表支持的外部表。