dolphin_env.py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. """
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. """
  16. from resource_management import *
  17. def dolphin_env():
  18. import params
  19. Directory(params.dolphin_pidfile_dir,
  20. mode=0777,
  21. owner=params.dolphin_user,
  22. group=params.dolphin_group,
  23. create_parents=True
  24. )
  25. Directory(params.dolphin_log_dir,
  26. mode=0777,
  27. owner=params.dolphin_user,
  28. group=params.dolphin_group,
  29. create_parents=True
  30. )
  31. Directory(params.dolphin_conf_dir,
  32. mode=0777,
  33. owner=params.dolphin_user,
  34. group=params.dolphin_group,
  35. create_parents=True
  36. )
  37. Directory(params.dolphin_common_map['data.basedir.path'],
  38. mode=0777,
  39. owner=params.dolphin_user,
  40. group=params.dolphin_group,
  41. create_parents=True
  42. )
  43. File(format(params.dolphin_env_path),
  44. mode=0777,
  45. content=InlineTemplate(params.dolphin_env_content),
  46. owner=params.dolphin_user,
  47. group=params.dolphin_group
  48. )
  49. File(format(params.dolphin_bin_dir + "/dolphinscheduler-daemon.sh"),
  50. mode=0755,
  51. content=Template("dolphin-daemon.sh.j2"),
  52. owner=params.dolphin_user,
  53. group=params.dolphin_group
  54. )
  55. File(format(params.dolphin_conf_dir + "/master.properties"),
  56. mode=0755,
  57. content=Template("master.properties.j2"),
  58. owner=params.dolphin_user,
  59. group=params.dolphin_group
  60. )
  61. File(format(params.dolphin_conf_dir + "/worker.properties"),
  62. mode=0755,
  63. content=Template("worker.properties.j2"),
  64. owner=params.dolphin_user,
  65. group=params.dolphin_group
  66. )
  67. File(format(params.dolphin_conf_dir + "/alert.properties"),
  68. mode=0755,
  69. content=Template("alert.properties.j2"),
  70. owner=params.dolphin_user,
  71. group=params.dolphin_group
  72. )
  73. File(format(params.dolphin_conf_dir + "/datasource.properties"),
  74. mode=0755,
  75. content=Template("datasource.properties.j2"),
  76. owner=params.dolphin_user,
  77. group=params.dolphin_group
  78. )
  79. File(format(params.dolphin_conf_dir + "/application-api.properties"),
  80. mode=0755,
  81. content=Template("application-api.properties.j2"),
  82. owner=params.dolphin_user,
  83. group=params.dolphin_group
  84. )
  85. File(format(params.dolphin_conf_dir + "/common.properties"),
  86. mode=0755,
  87. content=Template("common.properties.j2"),
  88. owner=params.dolphin_user,
  89. group=params.dolphin_group
  90. )
  91. File(format(params.dolphin_conf_dir + "/quartz.properties"),
  92. mode=0755,
  93. content=Template("quartz.properties.j2"),
  94. owner=params.dolphin_user,
  95. group=params.dolphin_group
  96. )
  97. File(format(params.dolphin_conf_dir + "/zookeeper.properties"),
  98. mode=0755,
  99. content=Template("zookeeper.properties.j2"),
  100. owner=params.dolphin_user,
  101. group=params.dolphin_group
  102. )