diff --git a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml
index 7e2023603c..a93f7fa273 100644
--- a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml
+++ b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml
@@ -1617,9 +1617,12 @@
fs.s3a.buffer.dir
- ${hadoop.tmp.dir}/s3a
+ ${env.LOCAL_DIRS:-${hadoop.tmp.dir}}/s3a
Comma separated list of directories that will be used to buffer file
- uploads to.
+ uploads to.
+ Yarn container path will be used as default value on yarn applications,
+ otherwise fall back to hadoop.tmp.dir
+
diff --git a/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/committers.md b/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/committers.md
index 989fdd0fd8..b19f30f1a3 100644
--- a/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/committers.md
+++ b/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/committers.md
@@ -546,7 +546,7 @@ Conflict management is left to the execution engine itself.
| Option | Meaning | Default |
|--------|---------|---------|
| `mapreduce.fileoutputcommitter.marksuccessfuljobs` | Write a `_SUCCESS` file on the successful completion of the job. | `true` |
-| `fs.s3a.buffer.dir` | Local filesystem directory for data being written and/or staged. | `${hadoop.tmp.dir}/s3a` |
+| `fs.s3a.buffer.dir` | Local filesystem directory for data being written and/or staged. | `${env.LOCAL_DIRS:-${hadoop.tmp.dir}}/s3a` |
| `fs.s3a.committer.magic.enabled` | Enable "magic committer" support in the filesystem. | `true` |
| `fs.s3a.committer.abort.pending.uploads` | list and abort all pending uploads under the destination path when the job is committed or aborted. | `true` |
| `fs.s3a.committer.threads` | Number of threads in committers for parallel operations on files. | 8 |
diff --git a/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md b/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md
index f390f1d5f8..aa4e13ff3d 100644
--- a/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md
+++ b/hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md
@@ -967,9 +967,12 @@ options are covered in [Testing](./testing.md).
fs.s3a.buffer.dir
- ${hadoop.tmp.dir}/s3a
+ ${env.LOCAL_DIRS:-${hadoop.tmp.dir}}/s3a
Comma separated list of directories that will be used to buffer file
- uploads to.
+ uploads to.
+ Yarn container path will be used as default value on yarn applications,
+ otherwise fall back to hadoop.tmp.dir
+
@@ -1746,9 +1749,12 @@ consumed, and so eliminates heap size as the limiting factor in queued uploads
fs.s3a.buffer.dir
- ${hadoop.tmp.dir}/s3a
+ ${env.LOCAL_DIRS:-${hadoop.tmp.dir}}/s3a
Comma separated list of directories that will be used to buffer file
- uploads to.
+ uploads to.
+ Yarn container path will be used as default value on yarn applications,
+ otherwise fall back to hadoop.tmp.dir
+
```