首页 > 解决方案 > 为 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
}

我在这里附上了截图。

但我收到以下错误:

Please retry: Error (invalid JSON mapping)

我该如何解决这个问题?

标签: jsoncassandraapache-drill

解决方案


所有代码:

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

1. Get Drill:让我们获取 Drill 源

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

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

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

3. 在 Drill 上应用补丁 $ cd Drill $ git apply --check ~/Downloads/DRILL-92-CassandraStorage.patch $ git apply ~/Downloads/DRILL-92-CassandraStorage.patch

4. 使用 Cassandra Storage 构建 Drill 并导出分发到 /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 模式

6. Drill 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


推荐阅读