[ https://issues.apache.org/jira/browse/FLINK-7477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16133120#comment-16133120 ]
ASF GitHub Bot commented on FLINK-7477: --------------------------------------- Github user rmetzger commented on a diff in the pull request: https://github.com/apache/flink/pull/4566#discussion_r133985865 --- Diff: flink-dist/src/main/flink-bin/bin/config.sh --- @@ -351,8 +351,20 @@ if [ -z "$HADOOP_CONF_DIR" ]; then fi fi +# try and set HADOOP_CONF_DIR to some common default if it's not set +if [ -z "$HADOOP_CONF_DIR" ]; then + if [ -d "/etc/hadoop/conf" ]; then + HADOOP_CONF_DIR="/etc/hadoop/conf" + fi +fi + INTERNAL_HADOOP_CLASSPATHS="${HADOOP_CLASSPATH}:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}" +# check if the "hadoop" binary is available, if yes, use that to augment the CLASSPATH +if command -v hadoop >/dev/null 2>&1; then + INTERNAL_HADOOP_CLASSPATHS="${HADOOP_CLASSPATH}:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}:`hadoop classpath`" --- End diff -- I would actually append `INTERNAL_HADOOP_CLASSPATHS` instead of overwriting it. > Use "hadoop classpath" to augment classpath when available > ---------------------------------------------------------- > > Key: FLINK-7477 > URL: https://issues.apache.org/jira/browse/FLINK-7477 > Project: Flink > Issue Type: Bug > Components: Startup Shell Scripts > Reporter: Aljoscha Krettek > Assignee: Aljoscha Krettek > Fix For: 1.4.0 > > > Currently, some cloud environments don't properly put the Hadoop jars into > {{HADOOP_CLASSPATH}} (or don't set {{HADOOP_CLASSPATH}}) at all. We should > check in {{config.sh}} if the {{hadoop}} binary is on the path and augment > our {{INTERNAL_HADOOP_CLASSPATHS}} with the result of {{hadoop classpath}} in > our scripts. > This will improve the out-of-box experience of users that otherwise have to > manually set {{HADOOP_CLASSPATH}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)