HDFS-13049. RBF: Inconsistent Router OPTS config in branch-2 and branch-3. Contributed by Wei Yan.

This commit is contained in:
Wei Yan 2018-01-25 12:58:16 -08:00
parent bed683d300
commit cefe4b7bb6
4 changed files with 35 additions and 2 deletions

View File

@ -74,6 +74,15 @@ set HADOOP_SECURE_DN_USER=%HADOOP_SECURE_DN_USER%
@rem Where log files are stored in the secure data environment. @rem Where log files are stored in the secure data environment.
set HADOOP_SECURE_DN_LOG_DIR=%HADOOP_LOG_DIR%\%HADOOP_HDFS_USER% set HADOOP_SECURE_DN_LOG_DIR=%HADOOP_LOG_DIR%\%HADOOP_HDFS_USER%
@rem
@rem Router-based HDFS Federation specific parameters
@rem Specify the JVM options to be used when starting the RBF Routers.
@rem These options will be appended to the options specified as HADOOP_OPTS
@rem and therefore may override any similar flags set in HADOOP_OPTS
@rem
@rem set HADOOP_DFSROUTER_OPTS=""
@rem
@rem The directory where pid files are stored. /tmp by default. @rem The directory where pid files are stored. /tmp by default.
@rem NOTE: this should be set to a directory that can only be written to by @rem NOTE: this should be set to a directory that can only be written to by
@rem the user that will run the hadoop daemons. Otherwise there is the @rem the user that will run the hadoop daemons. Otherwise there is the

View File

@ -93,6 +93,15 @@ export HADOOP_SECURE_DN_USER=${HADOOP_SECURE_DN_USER}
# #
# export HADOOP_MOVER_OPTS="" # export HADOOP_MOVER_OPTS=""
###
# Router-based HDFS Federation specific parameters
# Specify the JVM options to be used when starting the RBF Routers.
# These options will be appended to the options specified as HADOOP_OPTS
# and therefore may override any similar flags set in HADOOP_OPTS
#
# export HADOOP_DFSROUTER_OPTS=""
###
### ###
# Advanced Users Only! # Advanced Users Only!
### ###

View File

@ -134,6 +134,13 @@ if [ "$COMMAND" == "nfs3" ] && [ "$EUID" -eq 0 ] && [ -n "$HADOOP_PRIVILEGED_NFS
fi fi
fi fi
# Determine if we're using deprecated config HADOOP_ROUTER_OPTS
if [ "$COMMAND" == "dfsrouter" ] && [ "$HADOOP_ROUTER_OPTS" != "" ]; then
echo "WARNING: it looks like you're using a deprecated config HADOOP_ROUTER_OPTS. "\
"Please switch to HADOOP_DFSROUTER_OPTS."
HADOOP_DFSROUTER_OPTS=$HADOOP_ROUTER_OPTS
fi
if [ "$COMMAND" = "namenode" ] ; then if [ "$COMMAND" = "namenode" ] ; then
CLASS='org.apache.hadoop.hdfs.server.namenode.NameNode' CLASS='org.apache.hadoop.hdfs.server.namenode.NameNode'
HADOOP_OPTS="$HADOOP_OPTS $HADOOP_NAMENODE_OPTS" HADOOP_OPTS="$HADOOP_OPTS $HADOOP_NAMENODE_OPTS"
@ -161,7 +168,7 @@ elif [ "$COMMAND" = "dfsadmin" ] ; then
HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS" HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
elif [ "$COMMAND" = "dfsrouter" ] ; then elif [ "$COMMAND" = "dfsrouter" ] ; then
CLASS='org.apache.hadoop.hdfs.server.federation.router.DFSRouter' CLASS='org.apache.hadoop.hdfs.server.federation.router.DFSRouter'
HADOOP_OPTS="$HADOOP_OPTS $HADOOP_ROUTER_OPTS" HADOOP_OPTS="$HADOOP_OPTS $HADOOP_DFSROUTER_OPTS"
elif [ "$COMMAND" = "dfsrouteradmin" ] ; then elif [ "$COMMAND" = "dfsrouteradmin" ] ; then
CLASS='org.apache.hadoop.hdfs.tools.federation.RouterAdmin' CLASS='org.apache.hadoop.hdfs.tools.federation.RouterAdmin'
elif [ "$COMMAND" = "haadmin" ] ; then elif [ "$COMMAND" = "haadmin" ] ; then

View File

@ -59,6 +59,14 @@ if "%1" == "--loglevel" (
) )
) )
if "%hdfs-command%" == "dfsrouter" (
if defined HADOOP_ROUTER_OPTS (
@echo WARNING: it looks like you're using a deprecated config HADOOP_ROUTER_OPTS.
@echo Please switch to HADOOP_DFSROUTER_OPTS.
set HADOOP_DFSROUTER_OPTS=%HADOOP_ROUTER_OPTS%
)
)
set hdfscommands=dfs namenode secondarynamenode journalnode zkfc datanode dfsadmin haadmin fsck balancer jmxget oiv oev fetchdt getconf groups snapshotDiff lsSnapshottableDir cacheadmin mover storagepolicies classpath crypto dfsrouter dfsrouteradmin debug set hdfscommands=dfs namenode secondarynamenode journalnode zkfc datanode dfsadmin haadmin fsck balancer jmxget oiv oev fetchdt getconf groups snapshotDiff lsSnapshottableDir cacheadmin mover storagepolicies classpath crypto dfsrouter dfsrouteradmin debug
for %%i in ( %hdfscommands% ) do ( for %%i in ( %hdfscommands% ) do (
if %hdfs-command% == %%i set hdfscommand=true if %hdfs-command% == %%i set hdfscommand=true
@ -181,7 +189,7 @@ goto :eof
:dfsrouter :dfsrouter
set CLASS=org.apache.hadoop.hdfs.server.federation.router.DFSRouter set CLASS=org.apache.hadoop.hdfs.server.federation.router.DFSRouter
set HADOOP_OPTS=%HADOOP_OPTS% %HADOOP_ROUTER_OPTS% set HADOOP_OPTS=%HADOOP_OPTS% %HADOOP_DFSROUTER_OPTS%
goto :eof goto :eof
:dfsrouteradmin :dfsrouteradmin