1
0

hadoop-kms.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/env bash
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. if [[ "${HADOOP_SHELL_EXECNAME}" = hadoop ]]; then
  17. hadoop_add_subcommand "kms" daemon "run KMS, the Key Management Server"
  18. fi
  19. ## @description Command handler for kms subcommand
  20. ## @audience private
  21. ## @stability stable
  22. ## @replaceable no
  23. function hadoop_subcommand_kms
  24. {
  25. if [[ -f "${HADOOP_CONF_DIR}/kms-env.sh" ]]; then
  26. # shellcheck disable=SC1090
  27. . "${HADOOP_CONF_DIR}/kms-env.sh"
  28. fi
  29. hadoop_deprecate_envvar KMS_CONFIG HADOOP_CONF_DIR
  30. hadoop_deprecate_envvar KMS_LOG HADOOP_LOG_DIR
  31. hadoop_using_envvar KMS_HTTP_PORT
  32. hadoop_using_envvar KMS_MAX_HTTP_HEADER_SIZE
  33. hadoop_using_envvar KMS_MAX_THREADS
  34. hadoop_using_envvar KMS_SSL_ENABLED
  35. hadoop_using_envvar KMS_SSL_KEYSTORE_FILE
  36. hadoop_using_envvar KMS_TEMP
  37. # shellcheck disable=SC2034
  38. HADOOP_SUBCMD_SUPPORTDAEMONIZATION=true
  39. # shellcheck disable=SC2034
  40. HADOOP_CLASSNAME=org.apache.hadoop.crypto.key.kms.server.KMSWebServer
  41. hadoop_add_param HADOOP_OPTS "-Dkms.config.dir=" \
  42. "-Dkms.config.dir=${HADOOP_CONF_DIR}"
  43. hadoop_add_param HADOOP_OPTS "-Dkms.log.dir=" \
  44. "-Dkms.log.dir=${HADOOP_LOG_DIR}"
  45. if [[ "${HADOOP_DAEMON_MODE}" == "default" ]] ||
  46. [[ "${HADOOP_DAEMON_MODE}" == "start" ]]; then
  47. hadoop_mkdir "${KMS_TEMP:-${HADOOP_HOME}/temp}"
  48. fi
  49. }