From 9023751de649a4808d61f79233024eaaf207920f Mon Sep 17 00:00:00 2001 From: Zhe Zhang Date: Thu, 11 Feb 2016 09:29:14 -0800 Subject: [PATCH] HADOOP-12764. Increase default value of KMS maxHttpHeaderSize and make it configurable. (zhz) Change-Id: Iabb766f6311b83a1ac03093b0ba26a0284b74d70 --- hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh | 4 ++++ .../hadoop-kms/src/main/libexec/kms-config.sh | 7 +++++++ hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh | 1 + .../hadoop-kms/src/main/tomcat/server.xml | 3 ++- .../hadoop-kms/src/main/tomcat/ssl-server.xml.conf | 1 + .../hadoop-kms/src/site/markdown/index.md.vm | 1 + 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh b/hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh index 44dfe6afcdd..7ac74bb244a 100644 --- a/hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh +++ b/hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh @@ -40,6 +40,10 @@ # # export KMS_MAX_THREADS=1000 +# The maximum size of Tomcat HTTP header +# +# export KMS_MAX_HTTP_HEADER_SIZE=65536 + # The location of the SSL keystore if using SSL # # export KMS_SSL_KEYSTORE_FILE=${HOME}/.keystore diff --git a/hadoop-common-project/hadoop-kms/src/main/libexec/kms-config.sh b/hadoop-common-project/hadoop-kms/src/main/libexec/kms-config.sh index 3ac929a2fc2..7c07b9a819b 100644 --- a/hadoop-common-project/hadoop-kms/src/main/libexec/kms-config.sh +++ b/hadoop-common-project/hadoop-kms/src/main/libexec/kms-config.sh @@ -143,6 +143,13 @@ else print "Using KMS_MAX_THREADS: ${KMS_MAX_THREADS}" fi +if [ "${KMS_MAX_HTTP_HEADER_SIZE}" = "" ]; then + export KMS_MAX_HTTP_HEADER_SIZE=65536 + print "Setting KMS_MAX_HTTP_HEADER_SIZE: ${KMS_MAX_HTTP_HEADER_SIZE}" +else + print "Using KMS_MAX_HTTP_HEADER_SIZE: ${KMS_MAX_HTTP_HEADER_SIZE}" +fi + if [ "${KMS_SSL_KEYSTORE_FILE}" = "" ]; then export KMS_SSL_KEYSTORE_FILE=${HOME}/.keystore print "Setting KMS_SSL_KEYSTORE_FILE: ${KMS_SSL_KEYSTORE_FILE}" diff --git a/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh b/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh index f6ef6a5d0cc..209303060df 100644 --- a/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh +++ b/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh @@ -57,6 +57,7 @@ catalina_opts="${catalina_opts} -Dkms.temp.dir=${KMS_TEMP}"; catalina_opts="${catalina_opts} -Dkms.admin.port=${KMS_ADMIN_PORT}"; catalina_opts="${catalina_opts} -Dkms.http.port=${KMS_HTTP_PORT}"; catalina_opts="${catalina_opts} -Dkms.max.threads=${KMS_MAX_THREADS}"; +catalina_opts="${catalina_opts} -Dkms.max.http.header.size=${KMS_MAX_HTTP_HEADER_SIZE}"; catalina_opts="${catalina_opts} -Dkms.ssl.keystore.file=${KMS_SSL_KEYSTORE_FILE}"; catalina_opts="${catalina_opts} -Djava.library.path=${JAVA_LIBRARY_PATH}"; diff --git a/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml b/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml index 516a6a9d0ca..d8fd161205b 100644 --- a/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml +++ b/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml @@ -75,7 +75,8 @@ + redirectPort="8443" + maxHttpHeaderSize="${kms.max.http.header.size}"/>