

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 開始使用串流任務
<a name="jobs-spark-streaming-getting-started"></a>

請參閱下列指示，了解如何開始使用串流任務。

1. 遵循 [Amazon EMR Serverless 入門來建立應用程式。](https://docs.aws.amazon.com/emr/latest/EMR-Serverless-UserGuide/getting-started.html)請注意，您的應用程式必須執行 [Amazon EMR 7.1.0 版](https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-710-release.html)或更新版本。

1. 一旦應用程式準備就緒，請將 `mode` 參數設定為 `STREAMING` 以提交串流任務，類似下列 AWS CLI 範例。

   ```
   aws emr-serverless start-job-run \
   --application-id {{<APPPLICATION_ID>}} \
   --execution-role-arn {{<JOB_EXECUTION_ROLE>}} \
   --mode 'STREAMING' \
   --job-driver '{
       "sparkSubmit": {
           "entryPoint": "s3://{{<streaming script>}}",
           "entryPointArguments": ["s3://{{<DOC-EXAMPLE-BUCKET-OUTPUT>}}/output"],
           "sparkSubmitParameters": "--conf spark.executor.cores=4
               --conf spark.executor.memory=16g 
               --conf spark.driver.cores=4
               --conf spark.driver.memory=16g 
               --conf spark.executor.instances=3"
       }
   }'
   ```