From 758fb8465a1348cc0ac9ee412eaf09c888244aec 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) (cherry picked from commit 64aef189656919327b11fe5e90ea680ca7ba83df) --- 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 6b4216fea9b..b2592e54559 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -218,6 +218,8 @@ Release 2.6.0 - UNRELEASED HADOOP-10731. Remove @date JavaDoc comment in ProgramDriver class (Henry Saputra 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 1bbec7f1856..88a2b8644ea 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 3e203995de4..dc603d4f909 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 588c2c87acd..b43225f62d7 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 d070b58f9ed..516a6a9d0ca 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 3a464ca47cf..6235b8b6bff 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 2e8405fe4df..76eb1a66c44 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