【问题标题】:Setting up and using GCP provided pub-sub-to-big-query DataFlow template设置和使用 GCP 提供的 pub-sub-to-big-query DataFlow 模板
【发布时间】:2019-01-09 13:12:49
【问题描述】:
我正在尝试将发布/订阅消息流式传输到具有匹配架构的 BigQuery 表中。我想使用 GCP 提供的 PubSubToBigQuery 模板来执行此操作,但无法成功设置。
这是我目前尝试过的
我创建了一个具有写入 GS 权限的 GCE 实例 (useful link)
从gitgit clone https://github.com/GoogleCloudPlatform/DataflowTemplates克隆GCP源
如指定 here,运行:
mvn compile exec:java -Dexec.mainClass=com.google.cloud.teleport.templates.PubSubToBigQuery...
该进程创建了在 /staging 存储桶中创建的所有 jar 文件。它应该在/templates桶中生成模板信息,但没有。
我在这里错过了什么?
【问题讨论】:
标签:
google-cloud-platform
google-cloud-dataflow
google-cloud-pubsub
【解决方案1】:
我尝试在项目根目录下执行这个命令:
#!/bin/bash
PROJECT_ID=XXX
BUCKET_NAME=XXX
PIPELINE_FOLDER=gs://YYY/dataflow/pipelines/pubsub-to-bigquery
# Set the runner
RUNNER=DataflowRunner
# Build the template
mvn compile exec:java \
-Dexec.mainClass=com.google.cloud.teleport.templates.PubSubToBigQuery \
-Dexec.cleanupDaemonThreads=false \
-Dexec.args=" \
--project=${PROJECT_ID} \
--stagingLocation=${PIPELINE_FOLDER}/staging \
--tempLocation=${PIPELINE_FOLDER}/temp \
--templateLocation=${PIPELINE_FOLDER}/template \
--runner=${RUNNER}"
并且成功生成了一个模板文件:
$gsutil ls -lh gs://YYY/dataflow/pipelines/pubsub-to-bigquery/template
228.33 KiB 2019-01-14T05:54:01Z gs://YYY/dataflow/pipelines/pubsub-to-bigquery/template
TOTAL: 1 objects, 233805 bytes (228.33 KiB)
你能把一些日志贴在你身边吗?