Repository: ambari Updated Branches: refs/heads/trunk ef0bc272c -> 89fef12a4
AMBARI-15820: HAWQ HDFS directory should be owned by postgres user if secured (bhuvnesh2703) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/89fef12a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/89fef12a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/89fef12a Branch: refs/heads/trunk Commit: 89fef12a4f4f51f63000f4b4de41495ec287b96c Parents: ef0bc27 Author: Bhuvnesh Chaudhary <[email protected]> Authored: Tue Apr 12 17:35:27 2016 -0700 Committer: Bhuvnesh Chaudhary <[email protected]> Committed: Tue Apr 12 17:35:27 2016 -0700 ---------------------------------------------------------------------- .../HAWQ/2.0.0/package/scripts/common.py | 18 +++++++----------- .../HAWQ/2.0.0/package/scripts/master_helper.py | 16 ---------------- .../hawq/activateStandby/step3_controller.js | 2 +- .../hawq/addStandby/step4_controller.js | 2 +- 4 files changed, 9 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/89fef12a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py index 665d18e..abd0992 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py @@ -272,11 +272,14 @@ def validate_configuration(): "hawq_global_rm_type property in hawq-site is set to 'yarn' but YARN is not configured. " + "Please deploy YARN before starting HAWQ or change the value of hawq_global_rm_type property to 'none'") -def __init_component(component_name): +def start_component(component_name, port, data_dir): """ - Initializes the HAWQ component and creates hdfs data directory if master is being initialized + If data directory exists start the component, else initialize the component. + Initialization starts the component """ import params + + __check_dfs_truncate_enforced() if component_name == hawq_constants.MASTER: data_dir_owner = hawq_constants.hawq_user_secured if params.security_enabled else hawq_constants.hawq_user params.HdfsResource(params.hawq_hdfs_data_dir, @@ -284,22 +287,15 @@ def __init_component(component_name): action="create_on_execute", owner=data_dir_owner, group=hawq_constants.hawq_group, - recursive_chown = True, + recursive_chown=True, mode=0755) params.HdfsResource(None, action="execute") - utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(component_name)) - -def start_component(component_name, port, data_dir): - """ - If data directory exists start the component, else initialize the component - """ - __check_dfs_truncate_enforced() if os.path.exists(os.path.join(data_dir, hawq_constants.postmaster_opts_filename)): return utils.exec_hawq_operation(hawq_constants.START, "{0} -a -v".format(component_name), not_if=utils.chk_hawq_process_status_cmd(port)) - __init_component(component_name) + utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v".format(component_name)) def stop_component(component_name, port, mode): """ http://git-wip-us.apache.org/repos/asf/ambari/blob/89fef12a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py index 87d3c8a..670a58b 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py @@ -73,20 +73,4 @@ def configure_master(): common.create_master_dir(params.hawq_master_dir) common.create_temp_dirs(params.hawq_master_temp_dirs) -def __setup_hdfs_dirs(): - """ - Creates the required HDFS directories for HAWQ if they don't exist - or sets proper owner/mode if directory exists - """ - import params - - data_dir_owner = hawq_constants.hawq_user_secured if params.security_enabled else hawq_constants.hawq_user - params.HdfsResource(params.hawq_hdfs_data_dir, - type="directory", - action="create_on_execute", - owner=data_dir_owner, - group=hawq_constants.hawq_group, - recursive_chown = True, - mode=0755) - params.HdfsResource(None, action="execute") http://git-wip-us.apache.org/repos/asf/ambari/blob/89fef12a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js index c48015a..326b704 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js @@ -120,7 +120,7 @@ App.ActivateHawqStandbyWizardStep3Controller = App.HighAvailabilityProgressPageC }, startRequiredServices: function () { - this.startServices(true, [this.hawqServiceName], true); + this.startServices(false, [this.hawqServiceName], true); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/89fef12a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js index e98b997..8a5f456 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/addStandby/step4_controller.js @@ -84,7 +84,7 @@ App.AddHawqStandbyWizardStep4Controller = App.HighAvailabilityProgressPageContro }, startRequiredServices: function () { - this.startServices(true, ["HAWQ"], true); + this.startServices(false, ["HAWQ"], true); } });
