【问题标题】:How to run a GCP Cloud Function written in Golang to run a Dataflow job to import text file to Spanner?如何运行用 Golang 编写的 GCP Cloud Function 来运行 Dataflow 作业以将文本文件导入 Spanner?
【发布时间】:2022-12-15 10:04:15
【问题描述】:

我使用了示例:https://github.com/apache/beam/blob/master/sdks/go/examples/wordcount/wordcount.go#L82 以及 Google Cloud Support 的建议,使用以下内容运行数据流导入作业:

    flag.Parse()
    flag.Set("runner", "dataflow")
    flag.Set("project"xxxx "rp")
    flag.Set("region", "us-central1")
    flag.Set("staging_location", "gs://xxx/temp")
    flag.Set("job_name", "import-delivery_schedule")
    beam.Init()
    p := beam.NewPipeline()
    p.Root()
    if err := beamx.Run(context.Background(), p); err != nil {
        log.Fatalf("Failed to execute job: %v", err)
    }

云函数与数据库在同一个项目中。 数据流导入作业与数据库位于同一项目中。 导入作业从控制台成功运行。

但是,我无法让它工作。

我收到此错误:“函数执行耗时 18 毫秒,完成状态为:‘连接错误’”

【问题讨论】:

  • 你真的需要使用 Dataflow 在 spanner 中存储文本文件吗?您是否正确评估了您的管道选项?

标签: google-cloud-functions google-cloud-dataflow google-cloud-spanner


【解决方案1】:

我对将文本文件导入扳手表的其他方法持开放态度。你有什么建议?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-08
    相关资源
    最近更新 更多