Author: yusaku
Date: Wed Apr 24 23:31:36 2013
New Revision: 1471772
URL: http://svn.apache.org/r1471772
Log:
AMBARI-2011. Add Hosts gets stuck at 33% (some hosts in the cluster were down).
(yusaku)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/controllers/wizard.js
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
incubator/ambari/trunk/ambari-web/app/utils/ajax.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1471772&r1=1471771&r2=1471772&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Apr 24 23:31:36 2013
@@ -789,6 +789,9 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-2011. Add Hosts gets stuck at 33% (some hosts in the cluster were
+ down). (yusaku)
+
AMBARI-2014. Install Wizard/Add Host Wizard Review page: local repo option
is always displayed as "No", even when it is enabled. (yusaku)
Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard.js?rev=1471772&r1=1471771&r2=1471772&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard.js Wed Apr 24
23:31:36 2013
@@ -259,13 +259,28 @@ App.WizardController = Em.Controller.ext
switch (this.get('content.controllerName')) {
case 'addHostController':
+
+ var hostnames = [];
+ for (var hostname in App.db.getHosts()) {
+ hostnames.push(hostname);
+ }
+
if (isRetry) {
name = 'wizard.install_services.add_host_controller.is_retry';
}
else {
name = 'wizard.install_services.add_host_controller.not_is_retry';
}
- data = '{"RequestInfo": {"context" :"'+
Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles":
{"state": "INSTALLED"}}}';
+ data = {
+ "RequestInfo": {
+ "context": Em.I18n.t('requestInfo.installComponents'),
+ "query": "HostRoles/host_name.in(" + hostnames.join(',') + ")"
+ },
+ "Body": {
+ "HostRoles": {"state": "INSTALLED"}
+ }
+ };
+ data = JSON.stringify(data);
break;
case 'installerController':
default:
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js?rev=1471772&r1=1471771&r2=1471772&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step9_controller.js
Wed Apr 24 23:31:36 2013
@@ -332,12 +332,33 @@ App.WizardStep9Controller = Em.Controlle
* run start/check services after installation phase
*/
launchStartServices: function () {
- var data = '{"RequestInfo": {"context":
"'+Em.I18n.t("requestInfo.startServices")+'"}, "Body": {"ServiceInfo":
{"state": "STARTED"}}}';
+ var data = {
+ "RequestInfo": {
+ "context": Em.I18n.t("requestInfo.startServices")
+ },
+ "Body": {
+ "ServiceInfo": { "state": "STARTED" }
+ }
+ };
var name = 'wizard.step9.installer.launch_start_services';
+
if (this.get('content.controllerName') === 'addHostController') {
- data = '{"RequestInfo": {"context":
"'+Em.I18n.t("requestInfo.startHostComponents")+'"}, "Body": {"HostRoles":
{"state": "STARTED"}}}';
+ var hostnames = [];
+ for (var hostname in App.db.getHosts()) {
+ hostnames.push(hostname);
+ }
+ data = {
+ "RequestInfo": {
+ "context": Em.I18n.t("requestInfo.startHostComponents"),
+ "query":
"HostRoles/component_name.in(GANGLIA_MONITOR,HBASE_REGIONSERVER,DATANODE,TASKTRACKER)&HostRoles/state=INSTALLED&HostRoles/host_name.in("
+ hostnames.join(',') + ")"
+ },
+ "Body": {
+ "HostRoles": { "state": "STARTED" }
+ }
+ };
name = 'wizard.step9.add_host.launch_start_services';
}
+ data = JSON.stringify(data);
if (App.testMode) {
this.numPolls = 6;
}
Modified: incubator/ambari/trunk/ambari-web/app/utils/ajax.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/ajax.js?rev=1471772&r1=1471771&r2=1471772&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/ajax.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/ajax.js Wed Apr 24 23:31:36 2013
@@ -536,7 +536,7 @@ var urls = {
}
},
'wizard.install_services.add_host_controller.is_retry': {
- 'real': '/clusters/{cluster}/host_components?HostRoles/state=INSTALLED',
+ 'real': '/clusters/{cluster}/host_components',
'format': function (data, opt) {
return {
type: 'PUT',
@@ -546,7 +546,7 @@ var urls = {
}
},
'wizard.install_services.add_host_controller.not_is_retry': {
- 'real': '/clusters/{cluster}/host_components?HostRoles/state=INIT',
+ 'real': '/clusters/{cluster}/host_components',
'format': function (data, opt) {
return {
type: 'PUT',
@@ -556,7 +556,7 @@ var urls = {
}
},
'wizard.install_services.installer_controller.is_retry': {
- 'real': '/clusters/{cluster}/host_components?HostRoles/state!=INSTALLED',
+ 'real': '/clusters/{cluster}/host_components?HostRoles/state=INSTALLED',
'mock': '/data/wizard/deploy/2_hosts/poll_1.json',
'format': function (data, opt) {
return {
@@ -602,7 +602,7 @@ var urls = {
}
},
'wizard.step9.add_host.launch_start_services': {
- 'real':
'/clusters/{cluster}/host_components?(HostRoles/component_name=GANGLIA_MONITOR|HostRoles/component_name=HBASE_REGIONSERVER|HostRoles/component_name=DATANODE|HostRoles/component_name=TASKTRACKER)&(HostRoles/state=INSTALLED)',
+ 'real': '/clusters/{cluster}/host_components',
'mock': '/data/wizard/deploy/5_hosts/poll_6.json',
'format': function (data, opt) {
return {