ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject ambari git commit: AMBARI-14540. Fix single node installation issues for HAWQ(bhuvnesh chaudhary via odiachenko).
Date Sat, 09 Jan 2016 03:16:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c484c905d -> 0c049aa71


AMBARI-14540. Fix single node installation issues for HAWQ(bhuvnesh chaudhary via odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0c049aa7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0c049aa7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0c049aa7

Branch: refs/heads/trunk
Commit: 0c049aa710036c23bbef62e0f509635865b50718
Parents: c484c90
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Fri Jan 8 19:16:43 2016 -0800
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Fri Jan 8 19:16:43 2016 -0800

----------------------------------------------------------------------
 .../common-services/HAWQ/2.0.0/package/scripts/params.py      | 2 ++
 .../HAWQ/2.0.0/package/templates/hawq-hosts.j2                | 4 +---
 .../main/resources/stacks/HDP/2.3/services/stack_advisor.py   | 7 +++----
 ambari-web/app/controllers/wizard/step8_controller.js         | 2 ++
 ambari-web/app/models/stack_service_component.js              | 5 ++++-
 ambari-web/test/controllers/wizard/step8_test.js              | 6 +++++-
 6 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
index d92cc7f..4dc0874 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
@@ -55,6 +55,8 @@ hawq_password = config['configurations']['hawq-env']['hawq_password']
 hawqmaster_host = __get_component_host('hawqmaster_hosts')
 hawqstandby_host = __get_component_host('hawqstandby_hosts')
 hawqsegment_hosts = default('/clusterHostInfo/hawqsegment_hosts', [])
+hawq_master_hosts = [host for host in hawqmaster_host, hawqstandby_host if host]
+hawq_all_hosts = set(hawq_master_hosts + hawqsegment_hosts)
 
 
 # HDFS

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
index cdae3d8..e093375 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/templates/hawq-hosts.j2
@@ -17,8 +17,6 @@
 # under the License.
 #
 
-{{hawqmaster_host}}
-{{hawqstandby_host}}
-{% for host in hawqsegment_hosts %}
+{% for host in hawq_all_hosts %}
 {{host}}
 {% endfor %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 02c7482..dc64e24 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -65,8 +65,8 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
     componentsListList = [service["components"] for service in services["services"]]
     componentsList = [item for sublist in componentsListList for item in sublist]
-    hawqMasterHosts = [component["StackServiceComponents"]["hostnames"][0] for component
in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQMASTER"]
-    hawqStandbyHosts = [component["StackServiceComponents"]["hostnames"][0] for component
in componentsList if component["StackServiceComponents"]["component_name"] == "HAWQSTANDBY"]
+    hawqMasterHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"]
== "HAWQMASTER" for hostname in component["StackServiceComponents"]["hostnames"]]
+    hawqStandbyHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"]
== "HAWQSTANDBY" for hostname  in component["StackServiceComponents"]["hostnames"]]
 
     # single node case is not analyzed because HAWQ Standby Master will not be present in
single node topology due to logic in createComponentLayoutRecommendations()
     if len(hawqMasterHosts) == 1 and len(hawqStandbyHosts) == 1 and hawqMasterHosts == hawqStandbyHosts:
@@ -590,8 +590,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
   def isHawqMasterComponentOnAmbariServer(self, services):
     componentsListList = [service["components"] for service in services["services"]]
     componentsList = [item for sublist in componentsListList for item in sublist]
-    hawqMasterComponentHosts = [component["StackServiceComponents"]["hostnames"][0] for component
in componentsList 
-                               if component["StackServiceComponents"]["component_name"] in
("HAWQMASTER", "HAWQSTANDBY")]
+    hawqMasterComponentHosts = [hostname for component in componentsList if component["StackServiceComponents"]["component_name"]
in ("HAWQMASTER", "HAWQSTANDBY") for hostname in component["StackServiceComponents"]["hostnames"]]
     return any([self.isLocalHost(host) for host in hawqMasterComponentHosts])
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 89fed3c..ea79f5e 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -427,6 +427,8 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
App.wiz
         if (component.get('isMaster') && !component.get('isShownOnInstallerAssignMasterPage'))
return;
         // no HA component
         if (component.get('isHAComponentOnly')) return;
+        // skip if component is not allowed on single node cluster
+        if (Object.keys(this.get('content.hosts')).length == 1 && component.get('isNotAllowedOnSingleNodeCluster'))
return;
         var displayName;
         if (component.get('isClient')) {
           displayName = Em.I18n.t('common.clients')

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/app/models/stack_service_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js
index bb18cc4..ea8e910 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -171,7 +171,10 @@ App.StackServiceComponent = DS.Model.extend({
   }.property('componentName'),
 
   /** @property {Boolean} isNotAddableOnlyInInstall - is this component addable, except Install
and Add Service Wizards  **/
-  isNotAddableOnlyInInstall: Em.computed.existsIn('componentName', ['HIVE_METASTORE', 'HIVE_SERVER',
'RANGER_KMS_SERVER', 'OOZIE_SERVER'])
+  isNotAddableOnlyInInstall: Em.computed.existsIn('componentName', ['HIVE_METASTORE', 'HIVE_SERVER',
'RANGER_KMS_SERVER', 'OOZIE_SERVER']),
+
+  /** @property {Boolean} isNotAllowedOnSingleNodeCluster - is this component allowed on
single node  **/
+  isNotAllowedOnSingleNodeCluster: Em.computed.existsIn('componentName', ['HAWQSTANDBY'])
 
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c049aa7/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 426038c..14b7293 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -504,7 +504,11 @@ describe('App.WizardStep8Controller', function () {
       var content = Em.Object.create({
         services: services,
         selectedServices: selectedServices,
-        slaveComponentHosts: slaveComponentHosts
+        slaveComponentHosts: slaveComponentHosts,
+        hosts: Em.A([
+          Em.Object.create({hostName: 'h1', isInstalled: true}),
+          Em.Object.create({hostName: 'h2', isInstalled: false})
+        ])
       });
       installerStep8Controller.set('content', content);
       installerStep8Controller.set('services', Em.A([]));


Mime
View raw message