- Newest
- Most votes
- Most comments
Based on the information provided, I can identify a few potential issues with your EMR on EKS Spark executor configuration.
Issue 1: Spark ignoring mounted storage
When using Spark on Kubernetes (including EMR on EKS), the proper way to configure local storage directories is through the spark.local.dir configuration parameter. Environment variables like SPARK_LOCAL_DIRS and TMPDIR are not directly used by Spark to determine where to store shuffle data and temporary files.
Issue 2: Executors not created when setting spark.local.dir
Starting with Spark 3.3.1 (supported in EMR versions 6.10 and above), there's a known issue related to executor states during decommissioning. When you set spark.local.dir to a custom path, it might be conflicting with the dynamic resource allocation (DRA) feature, which is enabled by default in EMR.
Recommended approach:
-
Keep dynamic allocation enabled: Make sure
spark.dynamicAllocation.enabledis set totrue(this is the default in EMR). -
Set executor constraints: Add minimum and maximum executor constraints using
spark.dynamicAllocation.maxExecutorsandspark.dynamicAllocation.minExecutorsto control resource allocation. -
Use the correct Spark configuration: Instead of relying on environment variables, use the proper Spark configuration parameter:
'spark.kubernetes.executor.podTemplateFile': 's3://my-bucket/pod-templates/executor_template.yaml',
'spark.local.dir': '/opt/spark-local'
-
Check for access issues: The "no executors created" problem could be related to S3 access permissions. EMR might be encountering an "Access Denied" error when trying to access your pod template in S3. Verify that your EMR role has proper permissions to access the S3 bucket containing your pod templates.
-
Debug executor creation: To debug why executors aren't being created, check the driver logs for any error messages related to executor provisioning. Look specifically for S3 access denied errors or file system compatibility issues.
If you're still experiencing issues after these changes, you might need to adjust your pod template to ensure the storage path exists and has the correct permissions before Spark attempts to use it. The init container approach you're using is correct, but verify that the permissions are being applied correctly.
Sources
5.2 - Spark troubleshooting and performance tuning | AWS Open Data Analytics
Amazon EMR release 6.10.0 - Amazon EMR
Amazon EMR release 6.10.1 - Amazon EMR
Amazon EMR release 6.12.0 - Amazon EMR
Amazon EMR release 6.11.0 - Amazon EMR
answered a year ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
