[
https://issues.apache.org/jira/browse/MAPREDUCE-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Siyao Meng updated MAPREDUCE-7552:
----------------------------------
Description:
The default for {{mapreduce.admin.map.child.java.opts}} and
{{mapreduce.admin.reduce.child.java.opts}} pins task JVMs to IPv4:
{code:java}
public static final String DEFAULT_MAPRED_ADMIN_JAVA_OPTS =
"-Djava.net.preferIPv4Stack=true " +
"-Dhadoop.metrics.log.level=WARN ";
{code}
[MRJobConfig.java:1048|https://github.com/apache/hadoop/blob/9ede2e95c6fb577d7ae8664833d5e151cbfc47c9/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java#L1048]
Task JVMs do not take the stack preference from {{HADOOP_OPTS}}, so on an IPv6
cluster every map and reduce task keeps IPv4 only sockets. A task that connects
to a DataNode's IPv6 address fails with
{{java.nio.channels.UnsupportedAddressTypeException}}. On the IPv6
docker-compose test cluster, WordCount map tasks failed until the pin was
removed.
Operators can already remove the pin by setting both admin keys in
{{mapred-site.xml}}, or a job can add {{-Djava.net.preferIPv4Stack=false}} to
{{mapreduce.map.java.opts}} / {{mapreduce.reduce.java.opts}} (user opts come
after admin opts, so the last value wins). But neither key is documented
anywhere.
*Fix:* keep the default, since removing the pin would change task JVM
networking on every IPv4 cluster (daemons also still default to IPv4 in
{{hadoop-functions.sh}}). Document the override instead:
* {{mapred-default.xml}}: add both keys as commented-out entries with an IPv6
note. An active entry would put the default into every {{job.xml}}, which would
override a value set on the cluster nodes.
* {{ClusterSetup.md}}: a short note on removing the pin on an IPv6 cluster.
YARN services sets the same property in {{JavaCommandLineBuilder}}; that can be
handled separately.
was:
The default for {{mapreduce.admin.map.child.java.opts}} and
{{mapreduce.admin.reduce.child.java.opts}} pins task JVMs to IPv4:
{code:java}
public static final String DEFAULT_MAPRED_ADMIN_JAVA_OPTS =
"-Djava.net.preferIPv4Stack=true " +
"-Dhadoop.metrics.log.level=WARN ";
{code}
[MRJobConfig.java:1048|https://github.com/apache/hadoop/blob/9ede2e95c6fb577d7ae8664833d5e151cbfc47c9/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java#L1048]
Daemons take the stack preference from {{HADOOP_OPTS}}, which operators can now
override on both Unix and Windows (HADOOP-19935). Task JVMs cannot follow that
setting, so on an IPv6-only cluster every map and reduce task runs with
IPv4-only sockets. A task that connects to a DataNode's IPv6 address fails with
{{java.nio.channels.UnsupportedAddressTypeException}}. On the IPv6
docker-compose test cluster, WordCount map tasks failed until the pin was
removed.
*Proposed fix:* remove {{-Djava.net.preferIPv4Stack=true}} from
{{DEFAULT_MAPRED_ADMIN_JAVA_OPTS}} so task JVMs use the JVM default
(dual-stack), as daemons and the MR ApplicationMaster already do. IPv4-only
clusters keep working, because dual-stack sockets connect to IPv4 addresses.
Operators who want the old behaviour can set the property in
{{mapreduce.admin.*.child.java.opts}}. This changes a default, so it should get
a release note.
YARN services sets the same property in {{JavaCommandLineBuilder}}; that can be
handled separately.
POC:
https://github.com/smengcl/hadoop/commit/0ff1dc343907f1c6ecc622a52550967160ce055f
Summary: Document how to stop pinning MapReduce task JVMs to IPv4
(was: MapReduce task JVMs should not force java.net.preferIPv4Stack=true)
> Document how to stop pinning MapReduce task JVMs to IPv4
> --------------------------------------------------------
>
> Key: MAPREDUCE-7552
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7552
> Project: Hadoop Map/Reduce
> Issue Type: Improvement
> Reporter: Siyao Meng
> Assignee: Siyao Meng
> Priority: Major
> Labels: ipv6, pull-request-available
>
> The default for {{mapreduce.admin.map.child.java.opts}} and
> {{mapreduce.admin.reduce.child.java.opts}} pins task JVMs to IPv4:
> {code:java}
> public static final String DEFAULT_MAPRED_ADMIN_JAVA_OPTS =
> "-Djava.net.preferIPv4Stack=true " +
> "-Dhadoop.metrics.log.level=WARN ";
> {code}
> [MRJobConfig.java:1048|https://github.com/apache/hadoop/blob/9ede2e95c6fb577d7ae8664833d5e151cbfc47c9/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java#L1048]
> Task JVMs do not take the stack preference from {{HADOOP_OPTS}}, so on an
> IPv6 cluster every map and reduce task keeps IPv4 only sockets. A task that
> connects to a DataNode's IPv6 address fails with
> {{java.nio.channels.UnsupportedAddressTypeException}}. On the IPv6
> docker-compose test cluster, WordCount map tasks failed until the pin was
> removed.
> Operators can already remove the pin by setting both admin keys in
> {{mapred-site.xml}}, or a job can add {{-Djava.net.preferIPv4Stack=false}} to
> {{mapreduce.map.java.opts}} / {{mapreduce.reduce.java.opts}} (user opts come
> after admin opts, so the last value wins). But neither key is documented
> anywhere.
> *Fix:* keep the default, since removing the pin would change task JVM
> networking on every IPv4 cluster (daemons also still default to IPv4 in
> {{hadoop-functions.sh}}). Document the override instead:
> * {{mapred-default.xml}}: add both keys as commented-out entries with an IPv6
> note. An active entry would put the default into every {{job.xml}}, which
> would override a value set on the cluster nodes.
> * {{ClusterSetup.md}}: a short note on removing the pin on an IPv6 cluster.
> YARN services sets the same property in {{JavaCommandLineBuilder}}; that can
> be handled separately.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]