Add the S3 specific properties to the Spark configuration of your Databricks
cluster on AWS.
Before you begin
- Ensure that your Spark cluster in Databricks has been properly created and
is running and its version is 3.5 LTS. For further information, see Create Databricks workspace from Databricks
documentation.
- You have an AWS account.
- The S3 bucket to be used has been properly created and you have the appropriate permissions to access it.
- When you are using a Machine Learning component or
tMatchPredict, you have set the Databricks
Runtime Version setting to X.X LTS
ML.
Procedure
-
On the Configuration tab of your Databricks cluster
page, scroll down to the Spark tab at the bottom of the
page.
Example
-
Click Edit to make the fields on this page
editable.
-
In this Spark tab, enter the Spark properties regarding
the credentials to be used to access your S3 system.
- S3N
spark.hadoop.fs.s3n.awsAccessKeyId <your_access_key>
spark.hadoop.fs.s3n.access.key <your_access_key>
spark.hadoop.fs.s3n.awsSecretAccessKey <your_secret_key>
- S3A
spark.hadoop.fs.s3a.awsAccessKeyId <your_access_key>
spark.hadoop.fs.s3a.access.key <your_access_key>
spark.hadoop.fs.s3a.awsSecretAccessKey <your_secret_key>
-
If you need to run Spark Streaming Jobs with Databricks, in the same
Spark tab, add the following property to define a
default Spark serializer. If you do not plan to run Spark Streaming Jobs, you
can ignore this step.
spark.serializer org.apache.spark.serializer.KryoSerializer
-
Restart your Spark cluster.
-
In the Spark UI tab of your Databricks cluster page,
click Environment to display the list of properties and
verify that each of the properties you added in the previous steps is present on
that list.