Repository: ambari Updated Branches: refs/heads/branch-2.2 87ec53da5 -> 1fa2c5b92
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/1fa2c5b9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1fa2c5b9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1fa2c5b9 Branch: refs/heads/branch-2.2 Commit: 1fa2c5b9205654a3f8a6e511fb01082f53264659 Parents: 87ec53d Author: Bhuvnesh Chaudhary <bchaudh...@pivotal.io> Authored: Tue Apr 12 17:36:05 2016 -0700 Committer: Bhuvnesh Chaudhary <bchaudh...@pivotal.io> Committed: Tue Apr 12 17:36:05 2016 -0700 ---------------------------------------------------------------------- .../HAWQ/2.0.0/package/scripts/common.py | 17 +++++++---------- .../HAWQ/2.0.0/package/scripts/master_helper.py | 17 ----------------- .../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/1fa2c5b9/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 88bc4fa..413cf1a 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 @@ -271,11 +271,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 """ 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, @@ -286,19 +289,13 @@ def __init_component(component_name): 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/1fa2c5b9/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 9188b4b..a08eb84 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,3 @@ 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/1fa2c5b9/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/1fa2c5b9/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 8e1b641..ed08456 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,6 +84,6 @@ App.AddHawqStandbyWizardStep4Controller = App.HighAvailabilityProgressPageContro }, startRequiredServices: function () { - this.startServices(true, ["HAWQ"], true); + this.startServices(false, ["HAWQ"], true); } });