为Cassandra配置Apache演练

时间:2020-06-01 11:48:38

标签: json cassandra apache-drill

我正在尝试使用Drill配置Cassandra。我使用了链接上的相同方法:https://drill.apache.org/docs/starting-the-web-ui/

我对新存储插件使用了以下代码:

 {
  "type": "cassandra",
  "hosts": [
    "127.0.0.1"
  ],
  "port": 9042,
  "username": "<username>",
  "password": "<password>",
  "enabled": false
}

I have attached the Screenshot here.

但是我遇到了以下错误:

Please retry: Error (invalid JSON mapping)

我该如何解决?

2 个答案:

答案 0 :(得分:2)

所有代码:

  1. Git:https://github.com/yssharma/drill/tree/cassandra-storage
  2. 补丁:https://gist.github.com/yssharma/2581ae8a97c559b2677f

1。钻取:让我们获取钻取源

$ git clone https://github.com/apache/drill.git

2。获取Cassandra Storage补丁/从以下位置下载补丁文件:

https://reviews.apache.org/r/29816/diff/raw/

3。在Drill顶部应用补丁 $ cd钻 $ git apply --check〜/ Downloads / DRILL-92-CassandraStorage.patch $ git apply〜/ Downloads / DRILL-92-CassandraStorage.patch

4。使用Cassandra存储进行构建钻探并导出分发到/ opt / drill

$ mvn clean install -DskipTests
$ mkdir /opt/drill
$ tar xvzf distribution/target/*.tar.gz --strip=1 -C /opt/drill

5。启动Sqlline。 我们已经完成了Drill的构建和安装,并且可以开始使用Drill了。

$ cd /opt/drill
$ bin/sqlline -u jdbc:drill:zk=local -n admin -p admin
Drill-Sqlline

点击“显示模式”以查看现有模式。

Drill-Sqlline-schemas

6。钻取Web界面 您应该能够在localhost:8047或任何主机/端口上看到Drill Web界面。

使用它作为您的配置:

 {
      "type": "cassandra",
      "config": {
        "cassandra.hosts": [
          "127.0.0.1",
          "127.0.0.2"
        ],
        "cassandra.port": 9042
      },
      "enabled": true
    }

此外,如果这不起作用,请知道他们现在正在为此插件工作:https://github.com/apache/drill/pull/1960

答案 1 :(得分:1)

我也会在这里提供更新。我们正在对 Drill 与存储插件的工作方式进行一些认真的重构。具体来说,我们正在努力为 Cassandra 整合 Calcite Adapter1。原因是存储插件的难点不是连接,而是优化。 Calcite 已经为 Drill 进行了查询规划,并且已经实现了一堆这样的适配器,这意味着确定所有优化(AKA 下推)的工作基本上已经完成。

在 Cassandra/Scylla 的情况下,这一点尤为重要,因为有些过滤器应该下推到 Cassandra,有些绝对不应该下推。适配器还包括聚合下推——目前没有 Drill 插件可以做到这一点。再次强调的是,一旦我们提交了这一点,连接器就应该与 Cassandra/Scylla 一起工作。我们有一个非常接近完成的 ElasticSearch 插件,一旦完成,接下来是 Cassandra 插件。如果您有任何建议/意见或其他反馈,请在上面链接的拉取请求中发布。

** 2021 年 4 月 11 日更新:Cassandra/Scylla 插件现已合并到 Drill 1.19.0-SNAPSHOT **

相关问题