Google cloud storage 使用谷歌云存储的apachedrill
ApacheDrill功能列表提到它可以从Google云存储中查询数据,但我找不到任何关于如何做到这一点的信息。我认为S3可以很好地使用,但我怀疑我在谷歌云存储方面遗漏了一些非常简单的东西 有人有谷歌云存储的示例存储插件配置吗 谢谢Google cloud storage 使用谷歌云存储的apachedrill,google-cloud-storage,apache-drill,Google Cloud Storage,Apache Drill,ApacheDrill功能列表提到它可以从Google云存储中查询数据,但我找不到任何关于如何做到这一点的信息。我认为S3可以很好地使用,但我怀疑我在谷歌云存储方面遗漏了一些非常简单的东西 有人有谷歌云存储的示例存储插件配置吗 谢谢 我使用运行在Google Dataproc集群上的Apache Drill(1.6.0)在Google云存储(GCS)中查询拼花地板数据。 为了进行设置,我采取了以下步骤: 安装Drill并使GCS连接器可访问(这可以用作dataproc的初始化脚本,只需注意它没有
我使用运行在Google Dataproc集群上的Apache Drill(1.6.0)在Google云存储(GCS)中查询拼花地板数据。 为了进行设置,我采取了以下步骤:
gcs
),并使用以下配置(注意,我从s3配置中复制了大部分,做了一些小改动):
这是一个很老的问题,所以我想你要么找到了解决方案,要么继续你的生活,但对于那些不使用Dataproc寻找解决方案的人来说,这里有一个解决方案:
fs.gs.project.id
您的\u项目\u ID
可选。可以访问GCS存储桶的Google云项目ID。
仅列表存储桶和创建存储桶操作需要。
fs.gs.auth.service.account.private.key.id
您的\u私钥\u ID
fs.gs.auth.service.account.private.key
-----开始私钥------\n您的私钥------结束私钥------\n
fs.gs.auth.service.account.email
您的\服务\帐户\电子邮件/价值>
电子邮件地址与用于GCS的服务帐户相关联
当fs.gs.auth.service.account.enable为true时访问。要求的
在配置文件中指定身份验证密钥时(方法1)
或者正在使用PKCS12证书(方法3)。
fs.gs.working.dir
/
默认bucket内部的目录相对gs:uri解析。
fs.gs.implicit.dir.repair.enable
真的
是否为对象的父目录创建对象
在其路径中,例如在删除或删除时创建gs://bucket/foo/
重命名gs://bucket/foo/bar。
fs.gs.glob.flatlist.enable
真的
是否在单个列表中预填充潜在的全局匹配项
请求在嵌套glob情况下最小化对地面军事系统的呼叫。
fs.gs.copy.with.rewrite.enable
真的
是否使用重写请求执行复制操作。允许
在不同位置和存储类之间复制文件。
开始Apache训练
添加自定义存储以进行演练
你可以走了
解决方案来自,我在这里详细介绍了我们使用Apache Drill进行数据探索的方法。您知道如何做到这一点吗?我试过邮件列表和推特,但没有回答:/你找到解决办法了吗?我正在尝试在需要连接到google云存储的计算实例上运行钻取群集?如果我在计算实例上创建钻取群集并尝试访问google存储,我们该怎么做。我相信您需要。它是在Dataproc中预先安装的,我还没有尝试在其他场景中使用它,例如使用Drill的“裸”计算实例。如果您使用Dataproc,它会为您带来很多管理方面的麻烦,其缺点是其他不必要的服务在集群上运行,但根据我的经验,开销可以忽略不计。正如我在对此的评论中所分享的,这个答案和链接的博客对我来说是可行的,而不需要使用Dataproc。唯一需要注意的是,当我试图指定服务帐户电子邮件和私钥ID/值时,如上图所示,我会得到以下错误:
错误:系统错误:IOException:无效的PKCS8数据。
但是,将GCP提供的JSON文件复制到我的Drill实例,并根据博客对Hadoop连接器repo中指定格式的引用,指定fs.gs.auth.service.account.JSON.keyfile
,效果非常好
#!/bin/sh
set -x -e
BASEDIR="/opt/apache-drill-1.6.0"
mkdir -p ${BASEDIR}
cd ${BASEDIR}
wget http://apache.mesi.com.ar/drill/drill-1.6.0/apache-drill-1.6.0.tar.gz
tar -xzvf apache-drill-1.6.0.tar.gz
mv apache-drill-1.6.0/* .
rm -rf apache-drill-1.6.0 apache-drill-1.6.0.tar.gz
ln -s /usr/lib/hadoop/lib/gcs-connector-1.4.5-hadoop2.jar ${BASEDIR}/jars/gcs-connector-1.4.5-hadoop2.jar
mv ${BASEDIR}/conf/core-site.xml ${BASEDIR}/conf/core-site.xml.old
ln -s /etc/hadoop/conf/core-site.xml ${BASEDIR}/conf/core-site.xml
drillbit.sh start
set +x +e
{
"type": "file",
"enabled": true,
"connection": "gs://myBucketName",
"config": null,
"workspaces": {
"root": {
"location": "/",
"writable": false,
"defaultInputFormat": null
},
"tmp": {
"location": "/tmp",
"writable": true,
"defaultInputFormat": null
}
},
"formats": {
"psv": {
"type": "text",
"extensions": [
"tbl"
],
"delimiter": "|"
},
"csv": {
"type": "text",
"extensions": [
"csv"
],
"delimiter": ","
},
"tsv": {
"type": "text",
"extensions": [
"tsv"
],
"delimiter": "\t"
},
"parquet": {
"type": "parquet"
},
"json": {
"type": "json",
"extensions": [
"json"
]
},
"avro": {
"type": "avro"
},
"sequencefile": {
"type": "sequencefile",
"extensions": [
"seq"
]
},
"csvh": {
"type": "text",
"extensions": [
"csvh"
],
"extractHeader": true,
"delimiter": ","
}
}
}
select * from gs.`root`.`path/to/data/*` limit 10;
<property>
<name>fs.gs.project.id</name>
<value>YOUR_PROJECT_ID</value>
<description>
Optional. Google Cloud Project ID with access to GCS buckets.
Required only for list buckets and create bucket operations.
</description>
</property>
<property>
<name>fs.gs.auth.service.account.private.key.id</name>
<value>YOUR_PRIVATE_KEY_ID</value>
</property>
<property>
<name>fs.gs.auth.service.account.private.key</name>
<value>-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY\n-----END PRIVATE KEY-----\n</value>
</property>
<property>
<name>fs.gs.auth.service.account.email</name>
<value>YOUR_SERVICE_ACCOUNT_EMAIL/value>
<description>
The email address is associated with the service account used for GCS
access when fs.gs.auth.service.account.enable is true. Required
when authentication key specified in the Configuration file (Method 1)
or a PKCS12 certificate (Method 3) is being used.
</description>
</property>
<property>
<name>fs.gs.working.dir</name>
<value>/</value>
<description>
The directory relative gs: uris resolve in inside of the default bucket.
</description>
</property>
<property>
<name>fs.gs.implicit.dir.repair.enable</name>
<value>true</value>
<description>
Whether or not to create objects for the parent directories of objects
with / in their path e.g. creating gs://bucket/foo/ upon deleting or
renaming gs://bucket/foo/bar.
</description>
</property>
<property>
<name>fs.gs.glob.flatlist.enable</name>
<value>true</value>
<description>
Whether or not to prepopulate potential glob matches in a single list
request to minimize calls to GCS in nested glob cases.
</description>
</property>
<property>
<name>fs.gs.copy.with.rewrite.enable</name>
<value>true</value>
<description>
Whether or not to perform copy operation using Rewrite requests. Allows
to copy files between different locations and storage classes.
</description>
</property>