hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject hadoop git commit: HADOOP-14003. Make additional KMS tomcat settings configurable. Contributed by Andrew Wang.
Date Thu, 26 Jan 2017 19:22:32 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 a91cc63d3 -> 4a48f0e70


HADOOP-14003. Make additional KMS tomcat settings configurable. Contributed by Andrew Wang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4a48f0e7
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4a48f0e7
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4a48f0e7

Branch: refs/heads/branch-2
Commit: 4a48f0e70265b56e1e98660a50397d215cfc2b98
Parents: a91cc63
Author: Xiao Chen <xiao@apache.org>
Authored: Thu Jan 26 11:21:37 2017 -0800
Committer: Xiao Chen <xiao@apache.org>
Committed: Thu Jan 26 11:22:16 2017 -0800

----------------------------------------------------------------------
 .../hadoop-kms/src/main/conf/kms-env.sh         | 22 ++++++++++++++++++++
 .../hadoop-kms/src/main/libexec/kms-config.sh   | 21 +++++++++++++++++++
 .../hadoop-kms/src/main/sbin/kms.sh             |  3 +++
 .../hadoop-kms/src/main/tomcat/server.xml       |  4 +++-
 .../src/main/tomcat/ssl-server.xml.conf         |  4 +++-
 .../hadoop-kms/src/site/markdown/index.md.vm    |  3 +++
 6 files changed, 55 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/main/conf/kms-env.sh
----------------------------------------------------------------------
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 7ac74bb..1c70c28 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,10 +36,32 @@
 #
 # export KMS_ADMIN_PORT=`expr ${KMS_HTTP_PORT} + 1`
 
+# The Tomcat protocol to use for handling requests.
+# The default HTTP/1.1 handler is thread-per-request.
+# The NIO handler multiplexes multiple requests per thread.
+#
+# export KMS_PROTOCOL="HTTP/1.1"
+# export KMS_PROTOCOL="org.apache.coyote.http11.Http11NioProtocol"
+
 # The maximum number of Tomcat handler threads
 #
 # export KMS_MAX_THREADS=1000
 
+# The maximum queue length for incoming connection requests when all possible
+# request processing threads are in use. Any requests received when the queue
+# is full will be refused.
+#
+# export KMS_ACCEPT_COUNT=500
+
+# The number of threads to be used to accept connections. Increase this value
+# on a multi CPU machine, although you would never really need more than 2.
+# Also, with a lot of non keep alive connections, you might want to increase
+# this value as well.
+#
+# Increasing this has no effect unless using the NIO protocol.
+#
+# export KMS_ACCEPTOR_THREAD_COUNT=1
+
 # The maximum size of Tomcat HTTP header
 #
 # export KMS_MAX_HTTP_HEADER_SIZE=65536

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/main/libexec/kms-config.sh
----------------------------------------------------------------------
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 7c07b9a..bfdb83b 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_PROTOCOL}" = "" ]; then
+  export KMS_PROTOCOL="HTTP/1.1"
+  print "Setting KMS_PROTOCOL:     ${KMS_PROTOCOL}"
+else
+  print "Using   KMS_PROTOCOL:     ${KMS_PROTOCOL}"
+fi
+
 if [ "${KMS_MAX_THREADS}" = "" ]; then
   export KMS_MAX_THREADS=1000
   print "Setting KMS_MAX_THREADS:     ${KMS_MAX_THREADS}"
@@ -143,6 +150,20 @@ else
   print "Using   KMS_MAX_THREADS:     ${KMS_MAX_THREADS}"
 fi
 
+if [ "${KMS_ACCEPT_COUNT}" = "" ]; then
+  export KMS_ACCEPT_COUNT=500
+  print "Setting KMS_ACCEPT_COUNT:     ${KMS_ACCEPT_COUNT}"
+else
+  print "Using   KMS_ACCEPT_COUNT:     ${KMS_ACCEPT_COUNT}"
+fi
+
+if [ "${KMS_ACCEPTOR_THREAD_COUNT}" = "" ]; then
+  export KMS_ACCEPTOR_THREAD_COUNT=1
+  print "Setting KMS_ACCEPTOR_THREAD_COUNT:     ${KMS_ACCEPTOR_THREAD_COUNT}"
+else
+  print "Using   KMS_ACCEPTOR_THREAD_COUNT:     ${KMS_ACCEPTOR_THREAD_COUNT}"
+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}"

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh
----------------------------------------------------------------------
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 5232068..fb8ba33 100644
--- a/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh
+++ b/hadoop-common-project/hadoop-kms/src/main/sbin/kms.sh
@@ -64,7 +64,10 @@ 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.protocol=${KMS_PROTOCOL}";
 catalina_opts="${catalina_opts} -Dkms.max.threads=${KMS_MAX_THREADS}";
+catalina_opts="${catalina_opts} -Dkms.accept.count=${KMS_ACCEPT_COUNT}";
+catalina_opts="${catalina_opts} -Dkms.acceptor.thread.count=${KMS_ACCEPTOR_THREAD_COUNT}";
 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}";

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml
----------------------------------------------------------------------
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 d8fd161..2b38425 100644
--- a/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml
+++ b/hadoop-common-project/hadoop-kms/src/main/tomcat/server.xml
@@ -72,8 +72,10 @@
          APR (HTTP/AJP) Connector: /docs/apr.html
          Define a non-SSL HTTP/1.1 Connector on port ${kms.http.port}
     -->
-    <Connector port="${kms.http.port}" protocol="HTTP/1.1"
+    <Connector port="${kms.http.port}" protocol="${kms.protocol}"
                maxThreads="${kms.max.threads}"
+               acceptCount="${kms.accept.count}"
+               acceptorThreadCount="${kms.acceptor.thread.count}"
                connectionTimeout="20000"
                redirectPort="8443"
                maxHttpHeaderSize="${kms.max.http.header.size}"/>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml.conf
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml.conf b/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml.conf
index 01b429c..760da2f 100644
--- a/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml.conf
+++ b/hadoop-common-project/hadoop-kms/src/main/tomcat/ssl-server.xml.conf
@@ -68,8 +68,10 @@
          This connector uses the JSSE configuration, when using APR, the
          connector should be using the OpenSSL style configuration
          described in the APR documentation -->
-    <Connector port="${kms.http.port}" protocol="HTTP/1.1" SSLEnabled="true"
+    <Connector port="${kms.http.port}" protocol="${kms.protocol}" SSLEnabled="true"
                maxThreads="${kms.max.threads}" scheme="https" secure="true"
+               acceptCount="${kms.accept.count}"
+               acceptorThreadCount="${kms.acceptor.thread.count}"
                maxHttpHeaderSize="${kms.max.http.header.size}"
                clientAuth="false" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2,SSLv2Hello"
                truststorePass="_kms_ssl_truststore_pass_"

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4a48f0e7/hadoop-common-project/hadoop-kms/src/site/markdown/index.md.vm
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-kms/src/site/markdown/index.md.vm b/hadoop-common-project/hadoop-kms/src/site/markdown/index.md.vm
index 1cd8af7..bbce0b3 100644
--- a/hadoop-common-project/hadoop-kms/src/site/markdown/index.md.vm
+++ b/hadoop-common-project/hadoop-kms/src/site/markdown/index.md.vm
@@ -200,7 +200,10 @@ The following environment variables (which can be set in KMS's `etc/hadoop/kms-e
 
 * KMS_HTTP_PORT
 * KMS_ADMIN_PORT
+* KMS_PROTOCOL
 * KMS_MAX_THREADS
+* KMS_ACCEPT_COUNT
+* KMS_ACCEPTOR_THREAD_COUNT
 * KMS_MAX_HTTP_HEADER_SIZE
 * KMS_LOGNOTE: You need to restart the KMS for the configuration changes to take effect.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message