【问题标题】:Weird dse hive integration in DSE 4.7DSE 4.7 中奇怪的 dse hive 集成
【发布时间】:2015-08-28 07:59:39
【问题描述】:

我正在尝试对现有 C* 表运行 Hive 查询。

这是我的 C* 表定义:

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

这是我的外部配置单元表定义:

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* 表中:

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

运行相同的查询
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 hive 抱怨。我做错了什么?

【问题讨论】:

    标签: hadoop hive datastax datastax-enterprise


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-08-09
      • 2017-03-16
      • 2015-08-30
      • 2015-10-09
      • 1970-01-01
      • 2018-12-11
      • 2014-07-07
      • 2016-07-24
      • 1970-01-01
      相关资源
      最近更新 更多