diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/conf/httpfs-env.sh b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/conf/httpfs-env.sh index d0b50693259..47bb496e7a6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/conf/httpfs-env.sh +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/conf/httpfs-env.sh @@ -72,3 +72,9 @@ # The password of the SSL keystore if using SSL # # export HTTPFS_SSL_KEYSTORE_PASS=password + +# The full path to any native libraries that need to be loaded +# (For eg. location of natively compiled tomcat Apache portable +# runtime (APR) libraries +# +# export JAVA_LIBRARY_PATH=${HOME}/lib/native diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/sbin/httpfs.sh b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/sbin/httpfs.sh index 8accc598851..22164c855f2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/sbin/httpfs.sh +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/sbin/httpfs.sh @@ -31,7 +31,14 @@ BASEDIR=`cd ${BASEDIR}/..;pwd` HTTPFS_SILENT=${HTTPFS_SILENT:-true} -source ${HADOOP_LIBEXEC_DIR:-${BASEDIR}/libexec}/httpfs-config.sh +HADOOP_LIBEXEC_DIR="${HADOOP_LIBEXEC_DIR:-${BASEDIR}/libexec}" +source ${HADOOP_LIBEXEC_DIR}/httpfs-config.sh + +if [[ -z "${JAVA_LIBRARY_PATH}" ]]; then + JAVA_LIBRARY_PATH="${HADOOP_LIBEXEC_DIR}/../lib/native/" +else + JAVA_LIBRARY_PATH="${HADOOP_LIBEXEC_DIR}/../lib/native/:${JAVA_LIBRARY_PATH}" +fi # The Java System property 'httpfs.http.port' it is not used by HttpFS, # it is used in Tomcat's server.xml configuration file @@ -40,6 +47,7 @@ print "Using CATALINA_OPTS: ${CATALINA_OPTS}" catalina_opts="-Dproc_httpfs"; catalina_opts="${catalina_opts} -Dhttpfs.log.dir=${HTTPFS_LOG}" +catalina_opts="${catalina_opts} -Djava.library.path=${JAVA_LIBRARY_PATH}" print "Adding to CATALINA_OPTS: ${catalina_opts}"