params.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env python
  2. """
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  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. """
  17. from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
  18. from resource_management.libraries.functions.default import default
  19. from resource_management import *
  20. # server configurations
  21. config = Script.get_config()
  22. stack_name = default("/hostLevelParams/stack_name", None)
  23. # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
  24. version = default("/commandParams/version", None)
  25. stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
  26. hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
  27. #hadoop params
  28. if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
  29. slider_bin_dir = '/usr/hdp/current/slider-client/bin'
  30. else:
  31. slider_bin_dir = "/usr/lib/slider/bin"
  32. slider_conf_dir = "/etc/slider/conf"
  33. hadoop_conf_dir = "/etc/hadoop/conf"
  34. smokeuser = config['configurations']['cluster-env']['smokeuser']
  35. security_enabled = config['configurations']['cluster-env']['security_enabled']
  36. smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
  37. kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
  38. slider_env_sh_template = config['configurations']['slider-env']['content']
  39. java64_home = config['hostLevelParams']['java_home']
  40. log4j_props = config['configurations']['slider-log4j']['content']
  41. slider_cmd = format("{slider_bin_dir}/slider")
  42. storm_slider_conf_dir= '/usr/hdp/current/storm-slider-client/conf'
  43. slider_home_dir= '/usr/hdp/current/slider-client'