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
}
但我收到以下错误:
Please retry: Error (invalid JSON mapping)
我该如何解决这个问题?
解决方案
所有代码:
- Git:https ://github.com/yssharma/drill/tree/cassandra-storage
- 补丁: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
推荐阅读
- javascript - 将名称随机推入两个数组之一
- javascript - 如何使用 react.js 查看/嵌入 Excel (.xlsx) 数据或文件并使用过滤器显示到表格中。(使用 Cloud9)
- powershell - 反序列化来自 Invoke-Restmethod 的响应后禁用转换为 UTC 时区
- javascript - Javascript 创建自定义属性获取器(如在 python 中)
- flutter - 如何在 Flutter 中构建引导式应用程序
- flutter - Flutter 如何产生新的手势
- spss - SPSS Custom Tables - 如何计算列比例z检验的显着性
- jquery - How to import JavaScript files to React Component
- azure-storage - Azure 存储 - Blob 版本控制如何影响列表操作?
- c - 使用 RTOS 代码改进 LED 指示