|
@@ -956,86 +956,93 @@ App.MainHostDetailsController = Em.Controller.extend({
|
|
* @param {string} slaveType - slave component name
|
|
* @param {string} slaveType - slave component name
|
|
*/
|
|
*/
|
|
doDecommissionRegionServer: function (hostNames, serviceName, componentName, slaveType) {
|
|
doDecommissionRegionServer: function (hostNames, serviceName, componentName, slaveType) {
|
|
- App.ajax.send({
|
|
|
|
- name: 'host.host_component.recommission_and_restart',
|
|
|
|
- sender: this,
|
|
|
|
- data: {
|
|
|
|
- intervalTimeSeconds: 1,
|
|
|
|
- tolerateSize: 0,
|
|
|
|
- batches: [
|
|
|
|
- {
|
|
|
|
- "order_id": 1,
|
|
|
|
- "type": "POST",
|
|
|
|
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
- "RequestBodyInfo": {
|
|
|
|
- "RequestInfo": {
|
|
|
|
- "context": Em.I18n.t('hosts.host.regionserver.decommission.batch1'),
|
|
|
|
- "command": "DECOMMISSION",
|
|
|
|
- "parameters": {
|
|
|
|
- "slave_type": slaveType,
|
|
|
|
- "excluded_hosts": hostNames
|
|
|
|
- },
|
|
|
|
- 'operation_level': {
|
|
|
|
- level: "HOST_COMPONENT",
|
|
|
|
- cluster_name: App.get('clusterName'),
|
|
|
|
- host_name: hostNames,
|
|
|
|
- service_name: serviceName
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "Requests/resource_filters": [
|
|
|
|
- {"service_name": serviceName, "component_name": componentName}
|
|
|
|
- ]
|
|
|
|
|
|
+ var batches = [
|
|
|
|
+ {
|
|
|
|
+ "order_id": 1,
|
|
|
|
+ "type": "POST",
|
|
|
|
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
+ "RequestBodyInfo": {
|
|
|
|
+ "RequestInfo": {
|
|
|
|
+ "context": Em.I18n.t('hosts.host.regionserver.decommission.batch1'),
|
|
|
|
+ "command": "DECOMMISSION",
|
|
|
|
+ "exclusive" :"true",
|
|
|
|
+ "parameters": {
|
|
|
|
+ "slave_type": slaveType,
|
|
|
|
+ "excluded_hosts": hostNames
|
|
|
|
+ },
|
|
|
|
+ 'operation_level': {
|
|
|
|
+ level: "HOST_COMPONENT",
|
|
|
|
+ cluster_name: App.get('clusterName'),
|
|
|
|
+ host_name: hostNames,
|
|
|
|
+ service_name: serviceName
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- "order_id": 2,
|
|
|
|
- "type": "PUT",
|
|
|
|
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/host_components/" + slaveType,
|
|
|
|
- "RequestBodyInfo": {
|
|
|
|
- "RequestInfo": {
|
|
|
|
- context: Em.I18n.t('hosts.host.regionserver.decommission.batch2'),
|
|
|
|
- operation_level: {
|
|
|
|
- level: "HOST_COMPONENT",
|
|
|
|
- cluster_name: App.get('clusterName'),
|
|
|
|
- host_name: hostNames,
|
|
|
|
- service_name: serviceName || null
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "Body": {
|
|
|
|
- HostRoles: {
|
|
|
|
- state: "INSTALLED"
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ "Requests/resource_filters": [
|
|
|
|
+ {"service_name": serviceName, "component_name": componentName}
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+ var id = 2;
|
|
|
|
+ var hAray = hostNames.split(",");
|
|
|
|
+ for (var i = 0; i < hAray.length; i++) {
|
|
|
|
+ batches.push({
|
|
|
|
+ "order_id": id,
|
|
|
|
+ "type": "PUT",
|
|
|
|
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/hosts/" + hAray[i] + "/host_components/" + slaveType,
|
|
|
|
+ "RequestBodyInfo": {
|
|
|
|
+ "RequestInfo": {
|
|
|
|
+ context: Em.I18n.t('hosts.host.regionserver.decommission.batch2'),
|
|
|
|
+ exclusive: true,
|
|
|
|
+ operation_level: {
|
|
|
|
+ level: "HOST_COMPONENT",
|
|
|
|
+ cluster_name: App.get('clusterName'),
|
|
|
|
+ host_name: hostNames,
|
|
|
|
+ service_name: serviceName || null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- "order_id": 3,
|
|
|
|
- "type": "POST",
|
|
|
|
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
- "RequestBodyInfo": {
|
|
|
|
- "RequestInfo": {
|
|
|
|
- "context": Em.I18n.t('hosts.host.regionserver.decommission.batch3'),
|
|
|
|
- "command": "DECOMMISSION",
|
|
|
|
- "service_name": serviceName,
|
|
|
|
- "component_name": componentName,
|
|
|
|
- "parameters": {
|
|
|
|
- "slave_type": slaveType,
|
|
|
|
- "excluded_hosts": hostNames,
|
|
|
|
- "mark_draining_only": "true"
|
|
|
|
- },
|
|
|
|
- 'operation_level': {
|
|
|
|
- level: "HOST_COMPONENT",
|
|
|
|
- cluster_name: App.get('clusterName'),
|
|
|
|
- host_name: hostNames,
|
|
|
|
- service_name: serviceName
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "Requests/resource_filters": [
|
|
|
|
- {"service_name": serviceName, "component_name": componentName}
|
|
|
|
- ]
|
|
|
|
|
|
+ "Body": {
|
|
|
|
+ HostRoles: {
|
|
|
|
+ state: "INSTALLED"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ id++
|
|
|
|
+ }
|
|
|
|
+ batches.push({
|
|
|
|
+ "order_id": id,
|
|
|
|
+ "type": "POST",
|
|
|
|
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
+ "RequestBodyInfo": {
|
|
|
|
+ "RequestInfo": {
|
|
|
|
+ "context": Em.I18n.t('hosts.host.regionserver.decommission.batch3'),
|
|
|
|
+ "command": "DECOMMISSION",
|
|
|
|
+ "service_name": serviceName,
|
|
|
|
+ "component_name": componentName,
|
|
|
|
+ "parameters": {
|
|
|
|
+ "slave_type": slaveType,
|
|
|
|
+ "excluded_hosts": hostNames,
|
|
|
|
+ "mark_draining_only": true
|
|
|
|
+ },
|
|
|
|
+ 'operation_level': {
|
|
|
|
+ level: "HOST_COMPONENT",
|
|
|
|
+ cluster_name: App.get('clusterName'),
|
|
|
|
+ host_name: hostNames,
|
|
|
|
+ service_name: serviceName
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "Requests/resource_filters": [
|
|
|
|
+ {"service_name": serviceName, "component_name": componentName}
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ App.ajax.send({
|
|
|
|
+ name: 'host.host_component.recommission_and_restart',
|
|
|
|
+ sender: this,
|
|
|
|
+ data: {
|
|
|
|
+ intervalTimeSeconds: 1,
|
|
|
|
+ tolerateSize: 0,
|
|
|
|
+ batches: batches
|
|
},
|
|
},
|
|
success: 'decommissionSuccessCallback',
|
|
success: 'decommissionSuccessCallback',
|
|
error: 'decommissionErrorCallback'
|
|
error: 'decommissionErrorCallback'
|
|
@@ -1082,59 +1089,69 @@ App.MainHostDetailsController = Em.Controller.extend({
|
|
var context_1 = Em.I18n.t(contextNameString_1);
|
|
var context_1 = Em.I18n.t(contextNameString_1);
|
|
var contextNameString_2 = 'requestInfo.startHostComponent.' + slaveType.toLowerCase();
|
|
var contextNameString_2 = 'requestInfo.startHostComponent.' + slaveType.toLowerCase();
|
|
var startContext = Em.I18n.t(contextNameString_2);
|
|
var startContext = Em.I18n.t(contextNameString_2);
|
|
|
|
+ var params = {
|
|
|
|
+ "slave_type": slaveType,
|
|
|
|
+ "included_hosts": hostNames
|
|
|
|
+ };
|
|
|
|
+ if (serviceName == "HBASE") {
|
|
|
|
+ params.mark_draining_only = true;
|
|
|
|
+ }
|
|
|
|
+ var batches = [
|
|
|
|
+ {
|
|
|
|
+ "order_id": 1,
|
|
|
|
+ "type": "POST",
|
|
|
|
+ "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
+ "RequestBodyInfo": {
|
|
|
|
+ "RequestInfo": {
|
|
|
|
+ "context": context_1,
|
|
|
|
+ "command": "DECOMMISSION",
|
|
|
|
+ "exclusive":"true",
|
|
|
|
+ "parameters": params,
|
|
|
|
+ 'operation_level': {
|
|
|
|
+ level: "HOST_COMPONENT",
|
|
|
|
+ cluster_name: App.get('clusterName'),
|
|
|
|
+ host_name: hostNames,
|
|
|
|
+ service_name: serviceName
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "Requests/resource_filters": [
|
|
|
|
+ {"service_name": serviceName, "component_name": componentName}
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+ var id = 2;
|
|
|
|
+ var hAray = hostNames.split(",");
|
|
|
|
+ for (var i = 0; i < hAray.length; i++) {
|
|
|
|
+ batches.push( {
|
|
|
|
+ "order_id": id,
|
|
|
|
+ "type": "PUT",
|
|
|
|
+ "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/hosts/" + hAray[i] + "/host_components/" + slaveType,
|
|
|
|
+ "RequestBodyInfo": {
|
|
|
|
+ "RequestInfo": {
|
|
|
|
+ context: startContext,
|
|
|
|
+ operation_level: {
|
|
|
|
+ level: "HOST_COMPONENT",
|
|
|
|
+ cluster_name: App.get('clusterName'),
|
|
|
|
+ host_name: hostNames,
|
|
|
|
+ service_name: serviceName || null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "Body": {
|
|
|
|
+ HostRoles: {
|
|
|
|
+ state: "STARTED"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ id++;
|
|
|
|
+ }
|
|
App.ajax.send({
|
|
App.ajax.send({
|
|
name: 'host.host_component.recommission_and_restart',
|
|
name: 'host.host_component.recommission_and_restart',
|
|
sender: this,
|
|
sender: this,
|
|
data: {
|
|
data: {
|
|
intervalTimeSeconds: 1,
|
|
intervalTimeSeconds: 1,
|
|
tolerateSize: 1,
|
|
tolerateSize: 1,
|
|
- batches: [
|
|
|
|
- {
|
|
|
|
- "order_id": 1,
|
|
|
|
- "type": "POST",
|
|
|
|
- "uri": App.apiPrefix + "/clusters/" + App.get('clusterName') + "/requests",
|
|
|
|
- "RequestBodyInfo": {
|
|
|
|
- "RequestInfo": {
|
|
|
|
- "context": context_1,
|
|
|
|
- "command": "DECOMMISSION",
|
|
|
|
- "parameters": {
|
|
|
|
- "slave_type": slaveType,
|
|
|
|
- "included_hosts": hostNames
|
|
|
|
- },
|
|
|
|
- 'operation_level': {
|
|
|
|
- level: "HOST_COMPONENT",
|
|
|
|
- cluster_name: App.get('clusterName'),
|
|
|
|
- host_name: hostNames,
|
|
|
|
- service_name: serviceName
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "Requests/resource_filters": [
|
|
|
|
- {"service_name": serviceName, "component_name": componentName}
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- "order_id": 2,
|
|
|
|
- "type": "PUT",
|
|
|
|
- "uri": App.get('apiPrefix') + "/clusters/" + App.get('clusterName') + "/host_components/" + slaveType,
|
|
|
|
- "RequestBodyInfo": {
|
|
|
|
- "RequestInfo": {
|
|
|
|
- context: startContext,
|
|
|
|
- operation_level: {
|
|
|
|
- level: "HOST_COMPONENT",
|
|
|
|
- cluster_name: App.get('clusterName'),
|
|
|
|
- host_name: hostNames,
|
|
|
|
- service_name: serviceName || null
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "Body": {
|
|
|
|
- HostRoles: {
|
|
|
|
- state: "STARTED"
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ batches: batches
|
|
},
|
|
},
|
|
success: 'decommissionSuccessCallback',
|
|
success: 'decommissionSuccessCallback',
|
|
error: 'decommissionErrorCallback'
|
|
error: 'decommissionErrorCallback'
|
|
@@ -1169,6 +1186,7 @@ App.MainHostDetailsController = Em.Controller.extend({
|
|
"RequestInfo": {
|
|
"RequestInfo": {
|
|
"context": context_1,
|
|
"context": context_1,
|
|
"command": "DECOMMISSION",
|
|
"command": "DECOMMISSION",
|
|
|
|
+ "exclusive":"true",
|
|
"parameters": {
|
|
"parameters": {
|
|
"slave_type": slaveType,
|
|
"slave_type": slaveType,
|
|
"included_hosts": hostNames
|
|
"included_hosts": hostNames
|
|
@@ -1195,6 +1213,7 @@ App.MainHostDetailsController = Em.Controller.extend({
|
|
"command": "RESTART",
|
|
"command": "RESTART",
|
|
"service_name": serviceName,
|
|
"service_name": serviceName,
|
|
"component_name": slaveType,
|
|
"component_name": slaveType,
|
|
|
|
+ "exclusive":"true",
|
|
"hosts": hostNames
|
|
"hosts": hostNames
|
|
}
|
|
}
|
|
}
|
|
}
|