From 64aef189656919327b11fe5e90ea680ca7ba83df Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Mon, 29 Sep 2014 15:02:29 -0700 Subject: [PATCH] HADOOP-11153. Make number of KMS threads configurable. (wang) --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ 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 | 1 + .../hadoop-kms/src/main/tomcat/ssl-server.xml | 2 +- hadoop-common-project/hadoop-kms/src/site/apt/index.apt.vm | 2 ++ 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 4cb1b7327e..ea1d8fde58 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -554,6 +554,8 @@ Release 2.6.0 - UNRELEASED HADOOP-10954. Adding site documents of hadoop-tools (Masatake Iwasaki via aw) + HADOOP-11153. Make number of KMS threads configurable. (wang) + OPTIMIZATIONS HADOOP-10838. Byte array native checksumming. (James Thomas via todd) 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 1bbec7f185..88a2b8644e 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 @@ -36,6 +36,10 @@ # # export KMS_ADMIN_PORT=`expr ${KMS_HTTP_PORT} + 1` +# The maximum number of Tomcat handler threads +# +# export KMS_MAX_THREADS=1000 + # 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 3e203995de..dc603d4f90 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 @@ -136,6 +136,13 @@ else print "Using KMS_ADMIN_PORT: ${KMS_ADMIN_PORT}" fi +if [ "${KMS_MAX_THREADS}" = "" ]; then + export KMS_MAX_THREADS=1000 + print "Setting KMS_MAX_THREADS: ${KMS_MAX_THREADS}" +else + print "Using KMS_MAX_THREADS: ${KMS_MAX_THREADS}" +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 588c2c87ac..b43225f62d 100644 --- a/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh +++ b/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh @@ -44,6 +44,7 @@ catalina_opts="${catalina_opts} -Dkms.log.dir=${KMS_LOG}"; 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.ssl.keystore.file=${KMS_SSL_KEYSTORE_FILE}"; catalina_opts="${catalina_opts} -Dkms.ssl.keystore.pass=${KMS_SSL_KEYSTORE_PASS}"; 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 d070b58f9e..516a6a9d0c 100644 --- a/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml +++ b/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml @@ -73,6 +73,7 @@ Define a non-SSL HTTP/1.1 Connector on port ${kms.http.port} --> diff --git a/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml b/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml index 3a464ca47c..6235b8b6bf 100644 --- a/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml +++ b/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml @@ -69,7 +69,7 @@ connector should be using the OpenSSL style configuration described in the APR documentation --> diff --git a/hadoop-common-project/hadoop-kms/src/site/apt/index.apt.vm b/hadoop-common-project/hadoop-kms/src/site/apt/index.apt.vm index e32893b377..9b105f2825 100644 --- a/hadoop-common-project/hadoop-kms/src/site/apt/index.apt.vm +++ b/hadoop-common-project/hadoop-kms/src/site/apt/index.apt.vm @@ -152,6 +152,8 @@ hadoop-${project.version} $ sbin/kms.sh start * KMS_ADMIN_PORT + * KMS_MAX_THREADS + * KMS_LOG NOTE: You need to restart the KMS for the configuration changes to take