將資料從 Amazon S3 傳輸到 Google Cloud Storage¶
Google Cloud Storage (GCS) 用於儲存來自各種應用程式的大型資料。這與 Amazon Simple Storage Service 相同。本頁面說明如何將資料從 Amazon S3 傳輸到 GCS。
先決條件任務¶
若要使用這些運算子,您必須執行幾項操作
使用 Cloud Console 選取或建立 Cloud Platform 專案。
為您的專案啟用計費功能,如 Google Cloud 文件 中所述。
啟用 API,如 Cloud Console 文件 中所述。
透過 pip 安裝 API 程式庫。
pip install 'apache-airflow[google]'詳細資訊請參閱 安裝。
使用 S3ToGCSOperator
將資料從 Amazon S3 傳輸到 Google Cloud Storage。
可以使用可延遲模式非同步啟動 S3ToGCSOperator。若要執行此操作,只需在運算子呼叫中加入參數 deferrable=True
即可。在底層,它會將資料傳輸委派給 Google Cloud Storage Transfer Service。透過變更參數 poll_interval=10
,您可以控制輪詢傳輸工作狀態的頻率。