step8_controller.js 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. var stringUtils = require('utils/string_utils');
  20. App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
  21. name: 'wizardStep8Controller',
  22. /**
  23. * List of raw data about cluster that should be displayed
  24. * @type {Array}
  25. */
  26. rawContent: [
  27. {
  28. config_name: 'Admin',
  29. display_name: 'Admin Name',
  30. config_value: ''
  31. },
  32. {
  33. config_name: 'cluster',
  34. display_name: 'Cluster Name',
  35. config_value: ''
  36. },
  37. {
  38. config_name: 'hosts',
  39. display_name: 'Total Hosts',
  40. config_value: ''
  41. },
  42. {
  43. config_name: 'Repo',
  44. display_name: 'Local Repository',
  45. config_value: ''
  46. }
  47. ],
  48. /**
  49. * List of data about cluster (based on formatted <code>rawContent</code>)
  50. * @type {Object[]}
  51. */
  52. clusterInfo: [],
  53. /**
  54. * List of services with components assigned to hosts
  55. * @type {Object[]}
  56. */
  57. services: [],
  58. /**
  59. * @type {Object[]}
  60. */
  61. configs: [],
  62. /**
  63. * All configs
  64. * @type {Array}
  65. */
  66. configMapping: function () {
  67. return App.config.get('configMapping').all(true);
  68. }.property('App.config.configMapping'),
  69. /**
  70. *
  71. */
  72. slaveComponentConfig: null,
  73. /**
  74. * Should Submit button be disabled
  75. * @type {bool}
  76. */
  77. isSubmitDisabled: false,
  78. /**
  79. * Should Back button be disabled
  80. * @type {bool}
  81. */
  82. isBackBtnDisabled: false,
  83. /**
  84. * Is error appears while <code>ajaxQueue</code> executes
  85. * @type {bool}
  86. */
  87. hasErrorOccurred: false,
  88. /**
  89. * Are services installed
  90. * Used to hide Deploy Progress Bar
  91. * @type {bool}
  92. */
  93. servicesInstalled: false,
  94. /**
  95. * List of service config tags
  96. * @type {Object[]}
  97. */
  98. serviceConfigTags: [],
  99. /**
  100. * Ajax-requests queue
  101. * @type {App.ajaxQueue}
  102. */
  103. ajaxRequestsQueue: null,
  104. /**
  105. * Is cluster security enabled
  106. * @type {bool}
  107. */
  108. securityEnabled: function () {
  109. return App.router.get('mainAdminSecurityController.securityEnabled');
  110. }.property('App.router.mainAdminSecurityController.securityEnabled'),
  111. /**
  112. * Selected config group
  113. * @type {Object}
  114. */
  115. selectedConfigGroup: null,
  116. /**
  117. * List of config groups
  118. * @type {Object[]}
  119. */
  120. configGroups: [],
  121. /**
  122. * List of selected but not installed services
  123. * @type {Object[]}
  124. */
  125. selectedServices: function () {
  126. return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
  127. }.property('content.services.@each.isSelected','content.services.@each.isInstalled').cacheable(),
  128. /**
  129. * List of installed services
  130. * @type {Object[]}
  131. */
  132. installedServices: function () {
  133. return this.get('content.services').filterProperty('isInstalled');
  134. }.property('content.services').cacheable(),
  135. /**
  136. * Ajax-requests count
  137. * @type {number}
  138. */
  139. ajaxQueueLength: 0,
  140. /**
  141. * Current cluster name
  142. * @type {string}
  143. */
  144. clusterName: function () {
  145. return this.get('content.cluster.name');
  146. }.property('content.cluster.name'),
  147. /**
  148. * List of existing cluster names
  149. * @type {string[]}
  150. */
  151. clusterNames: [],
  152. /**
  153. * Clear current step data
  154. * @method clearStep
  155. */
  156. clearStep: function () {
  157. this.get('services').clear();
  158. this.get('configs').clear();
  159. this.get('clusterInfo').clear();
  160. this.get('serviceConfigTags').clear();
  161. this.set('servicesInstalled', false);
  162. this.set('ajaxQueueLength', 0);
  163. this.set('ajaxRequestsQueue', App.ajaxQueue.create());
  164. this.set('ajaxRequestsQueue.finishedCallback', this.ajaxQueueFinished);
  165. },
  166. /**
  167. * Load current step data
  168. * @method loadStep
  169. */
  170. loadStep: function () {
  171. console.log("TRACE: Loading step8: Review Page");
  172. this.clearStep();
  173. if (this.get('content.serviceConfigProperties')) {
  174. this.formatProperties();
  175. this.loadConfigs();
  176. if (this.get('content.controllerName') != 'installerController' && this.get('securityEnabled')) {
  177. this.prepareSecureConfigs();
  178. this.get('content.services').filterProperty('isSelected', true)
  179. .mapProperty('serviceName').forEach(function (serviceName) {
  180. var config = this.get('secureConfigs').findProperty('serviceName', serviceName);
  181. if (config) {
  182. this.setPrincipalValue(serviceName, config.name);
  183. }
  184. }, this);
  185. }
  186. }
  187. this.loadClusterInfo();
  188. this.loadServices();
  189. this.set('isSubmitDisabled', false);
  190. this.set('isBackBtnDisabled', false);
  191. },
  192. /**
  193. * replace whitespace character with coma between directories
  194. * @method formatProperties
  195. */
  196. formatProperties: function () {
  197. this.get('content.serviceConfigProperties').forEach(function (_configProperty) {
  198. _configProperty.value = App.config.trimProperty(_configProperty, false);
  199. });
  200. },
  201. /**
  202. * Remove unused Hive configs
  203. * @param {Ember.Enumerable} configs
  204. * @returns {Ember.Enumerable}
  205. * @method removeHiveConfigs
  206. */
  207. removeHiveConfigs: function (configs) {
  208. var hiveDb = configs.findProperty('name', 'hive_database');
  209. var hiveDbType = configs.findProperty('name', 'hive_database_type');
  210. if (hiveDbType) {
  211. var hive_properties = Em.A([]);
  212. switch (hiveDb.value) {
  213. case 'New MySQL Database':
  214. if (configs.someProperty('name', 'hive_ambari_host')) {
  215. configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_ambari_host').value;
  216. hiveDbType.value = 'mysql';
  217. }
  218. hive_properties = Em.A(['hive_existing_mysql_host', 'hive_existing_mysql_database', 'hive_existing_oracle_host',
  219. 'hive_existing_oracle_database', 'hive_existing_postgresql_host', 'hive_existing_postgresql_database']);
  220. break;
  221. case 'New PostgreSQL Database':
  222. if (configs.someProperty('name', 'hive_ambari_host')) {
  223. configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_ambari_host').value;
  224. hiveDbType.value = 'postgres';
  225. }
  226. hive_properties = Em.A(['hive_existing_mysql_host', 'hive_existing_mysql_database', 'hive_existing_oracle_host',
  227. 'hive_existing_oracle_database', 'hive_existing_postgresql_host', 'hive_existing_postgresql_database']);
  228. break;
  229. case 'Existing MySQL Database':
  230. configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_mysql_host').value;
  231. hiveDbType.value = 'mysql';
  232. hive_properties = Em.A(['hive_ambari_host', 'hive_ambari_database', 'hive_existing_oracle_host',
  233. 'hive_existing_oracle_database', 'hive_existing_postgresql_host', 'hive_existing_postgresql_database']);
  234. break;
  235. case Em.I18n.t('services.service.config.hive.oozie.postgresql'):
  236. configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_postgresql_host').value;
  237. hiveDbType.value = 'postgres';
  238. hive_properties = Em.A(['hive_ambari_host', 'hive_ambari_database', 'hive_existing_oracle_host',
  239. 'hive_existing_oracle_database', 'hive_existing_mysql_host', 'hive_existing_mysql_database']);
  240. break;
  241. default:
  242. configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_oracle_host').value;
  243. hiveDbType.value = 'oracle';
  244. hive_properties = Em.A(['hive_ambari_host', 'hive_ambari_database', 'hive_existing_mysql_host',
  245. 'hive_existing_mysql_database', 'hive_existing_postgresql_host', 'hive_existing_postgresql_database']);
  246. break;
  247. }
  248. hive_properties.forEach(function (property) {
  249. configs = configs.without(configs.findProperty('name', property));
  250. });
  251. }
  252. return configs;
  253. },
  254. /**
  255. * Remove unused Oozie configs
  256. * @param {Ember.Enumerable} configs
  257. * @returns {Ember.Enumerable}
  258. * @method removeOozieConfigs
  259. */
  260. removeOozieConfigs: function (configs) {
  261. var oozieDb = configs.findProperty('name', 'oozie_database');
  262. var oozieDbType = configs.findProperty('name', 'oozie_database_type');
  263. if (oozieDbType) {
  264. var oozie_properties = Em.A(['oozie_ambari_host', 'oozie_ambari_database']);
  265. switch (oozieDb.value) {
  266. case 'New Derby Database':
  267. configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_ambari_host').value;
  268. oozieDbType.value = 'derby';
  269. oozie_properties = Em.A(['oozie_ambari_host', 'oozie_ambari_database', 'oozie_existing_mysql_host',
  270. 'oozie_existing_mysql_database', 'oozie_existing_oracle_host', 'oozie_existing_oracle_database',
  271. 'oozie_existing_postgresql_host', 'oozie_existing_postgresql_database']);
  272. break;
  273. case 'Existing MySQL Database':
  274. configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_mysql_host').value;
  275. oozieDbType.value = 'mysql';
  276. oozie_properties = Em.A(['oozie_ambari_host', 'oozie_ambari_database', 'oozie_existing_oracle_host',
  277. 'oozie_existing_oracle_database', 'oozie_derby_database', 'oozie_existing_postgresql_host', 'oozie_existing_postgresql_database']);
  278. break;
  279. case Em.I18n.t('services.service.config.hive.oozie.postgresql'):
  280. configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_postgresql_host').value;
  281. oozieDbType.value = 'postgresql';
  282. oozie_properties = Em.A(['oozie_ambari_host', 'oozie_ambari_database', 'oozie_existing_oracle_host',
  283. 'oozie_existing_oracle_database', 'oozie_existing_mysql_host', 'oozie_existing_mysql_database']);
  284. break;
  285. default:
  286. configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_oracle_host').value;
  287. oozieDbType.value = 'oracle';
  288. oozie_properties = Em.A(['oozie_ambari_host', 'oozie_ambari_database', 'oozie_existing_mysql_host',
  289. 'oozie_existing_mysql_database', 'oozie_derby_database', 'oozie_existing_postgresql_host', 'oozie_existing_postgresql_database']);
  290. break;
  291. }
  292. oozie_properties.forEach(function (property) {
  293. configs = configs.without(configs.findProperty('name', property));
  294. });
  295. }
  296. return configs;
  297. },
  298. /**
  299. * Load all site properties
  300. * @method loadConfigs
  301. */
  302. loadConfigs: function () {
  303. //storedConfigs contains custom configs as well
  304. var configs = this.get('content.serviceConfigProperties');
  305. if (configs.someProperty('name', 'hive_database')) {
  306. configs = this.removeHiveConfigs(configs);
  307. }
  308. if (configs.someProperty('name', 'oozie_database')) {
  309. configs = this.removeOozieConfigs(configs);
  310. }
  311. configs.forEach(function (_config) {
  312. _config.value = (typeof _config.value === "boolean") ? _config.value.toString() : _config.value;
  313. });
  314. var mappedConfigs = App.config.excludeUnsupportedConfigs(this.get('configMapping'), this.get('selectedServices').mapProperty('serviceName'));
  315. var uiConfigs = this.loadUiSideConfigs(mappedConfigs);
  316. var customGroupConfigs = [];
  317. var allConfigs = configs.concat(uiConfigs).filter(function (config) {
  318. if (config.group) {
  319. customGroupConfigs.push(config);
  320. return false;
  321. } else {
  322. return true;
  323. }
  324. });
  325. this.set('customNonDefaultGroupConfigs', customGroupConfigs);
  326. this.set('configs', allConfigs);
  327. },
  328. /**
  329. * Load UI configs
  330. * @param {Array} configMapping
  331. * @return {Array}
  332. * @method loadUiSideConfigs
  333. */
  334. loadUiSideConfigs: function (configMapping) {
  335. var uiConfig = [];
  336. var configs = configMapping.filterProperty('foreignKey', null);
  337. this.addDynamicProperties(configs);
  338. configs.forEach(function (_config) {
  339. var valueWithOverrides = this.getGlobConfigValueWithOverrides(_config.templateName, _config.value, _config.name);
  340. uiConfig.pushObject({
  341. "id": "site property",
  342. "name": _config.name,
  343. "value": valueWithOverrides.value,
  344. "filename": _config.filename,
  345. "overrides": valueWithOverrides.overrides
  346. });
  347. }, this);
  348. var dependentConfig = $.extend(true, [], configMapping.filterProperty('foreignKey'));
  349. dependentConfig.forEach(function (_config) {
  350. App.config.setConfigValue(uiConfig, this.get('content.serviceConfigProperties'), _config);
  351. uiConfig.pushObject({
  352. "id": "site property",
  353. "name": _config._name || _config.name,
  354. "value": _config.value,
  355. "filename": _config.filename
  356. });
  357. }, this);
  358. return uiConfig;
  359. },
  360. /**
  361. * Add dynamic properties to configs
  362. * @param {Array} configs
  363. * @method addDynamicProperties
  364. */
  365. addDynamicProperties: function (configs) {
  366. var templetonHiveProperty = this.get('content.serviceConfigProperties').someProperty('name', 'templeton.hive.properties');
  367. if (!templetonHiveProperty) {
  368. configs.pushObject({
  369. "name": "templeton.hive.properties",
  370. "templateName": ["hivemetastore_host"],
  371. "foreignKey": null,
  372. "value": "hive.metastore.local=false,hive.metastore.uris=thrift://<templateName[0]>:9083,hive.metastore.sasl.enabled=yes,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse",
  373. "filename": "webhcat-site.xml"
  374. });
  375. }
  376. },
  377. /**
  378. * Format <code>content.hosts</code> from Object to Array
  379. * @returns {Array}
  380. * @method getRegisteredHosts
  381. */
  382. getRegisteredHosts: function () {
  383. var allHosts = this.get('content.hosts');
  384. var hosts = [];
  385. for (var hostName in allHosts) {
  386. if (allHosts.hasOwnProperty(hostName)) {
  387. if (allHosts[hostName].bootStatus == 'REGISTERED') {
  388. allHosts[hostName].hostName = allHosts[hostName].name;
  389. hosts.pushObject(allHosts[hostName]);
  390. }
  391. }
  392. }
  393. return hosts;
  394. },
  395. /**
  396. * Set all site property that are derived from other puppet-variable
  397. * @param {String} templateName
  398. * @param {String} expression
  399. * @param {String} name
  400. * @return {Object}
  401. * example: <code>{
  402. * value: '...',
  403. * overrides: [
  404. * {
  405. * value: 'v1',
  406. * hosts: ['h1', 'h2']
  407. * },
  408. * {
  409. * value: 'v2',
  410. * hosts: ['h2', 'h3']
  411. * },
  412. * ....
  413. * ]
  414. * }</code>
  415. * @method getGlobConfigValueWithOverrides
  416. */
  417. getGlobConfigValueWithOverrides: function (templateName, expression, name) {
  418. var express = expression.match(/<(.*?)>/g);
  419. var value = expression;
  420. if (express == null) {
  421. return { value: expression, overrides: []}; // if site property do not map any global property then return the value
  422. }
  423. var overrideHostToValue = {};
  424. express.forEach(function (_express) {
  425. //console.log("The value of template is: " + _express);
  426. var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
  427. if (this.get('configs').someProperty('name', templateName[index])) {
  428. //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
  429. var globalObj = this.get('configs').findProperty('name', templateName[index]);
  430. var globValue = globalObj.value;
  431. // Hack for templeton.zookeeper.hosts
  432. var preReplaceValue = null;
  433. if (value !== null) { // if the property depends on more than one template name like <templateName[0]>/<templateName[1]> then don't proceed to the next if the prior is null or not found in the global configs
  434. preReplaceValue = value;
  435. value = this._replaceConfigValues(name, _express, value, globValue);
  436. }
  437. if (globalObj.overrides != null) {
  438. globalObj.overrides.forEach(function (override) {
  439. var ov = override.value;
  440. var hostsArray = override.hosts;
  441. hostsArray.forEach(function (host) {
  442. if (!(host in overrideHostToValue)) {
  443. overrideHostToValue[host] = this._replaceConfigValues(name, _express, preReplaceValue, ov);
  444. } else {
  445. overrideHostToValue[host] = this._replaceConfigValues(name, _express, overrideHostToValue[host], ov);
  446. }
  447. }, this);
  448. }, this);
  449. }
  450. } else {
  451. /*
  452. console.log("ERROR: The variable name is: " + templateName[index]);
  453. console.log("ERROR: mapped config from configMapping file has no corresponding variable in " +
  454. "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
  455. "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
  456. */
  457. value = null;
  458. }
  459. }, this);
  460. var valueWithOverrides = {
  461. value: value,
  462. overrides: []
  463. };
  464. var overrideValueToHostMap = {};
  465. if (!jQuery.isEmptyObject(overrideHostToValue)) {
  466. for (var host in overrideHostToValue) {
  467. var hostVal = overrideHostToValue[host];
  468. if (!(hostVal in overrideValueToHostMap)) {
  469. overrideValueToHostMap[hostVal] = [];
  470. }
  471. overrideValueToHostMap[hostVal].push(host);
  472. }
  473. }
  474. for (var val in overrideValueToHostMap) {
  475. valueWithOverrides.overrides.push({
  476. value: val,
  477. hosts: overrideValueToHostMap[val]
  478. });
  479. }
  480. return valueWithOverrides;
  481. },
  482. /**
  483. * replace some values in config property
  484. * @param {string} name
  485. * @param {string} express
  486. * @param {string} value
  487. * @param {string} globValue
  488. * @return {string}
  489. * @private
  490. * @method _replaceConfigValues
  491. */
  492. _replaceConfigValues: function (name, express, value, globValue) {
  493. return value.replace(express, globValue);
  494. },
  495. /**
  496. * Load all info about cluster to <code>clusterInfo</code> variable
  497. * @method loadClusterInfo
  498. */
  499. loadClusterInfo: function () {
  500. //Admin name
  501. var admin = this.rawContent.findProperty('config_name', 'Admin');
  502. admin.config_value = App.db.getLoginName();
  503. console.log("STEP8: the value of content cluster name: " + App.db.getLoginName());
  504. if (admin.config_value) {
  505. this.get('clusterInfo').pushObject(Ember.Object.create(admin));
  506. }
  507. // cluster name
  508. var cluster = this.rawContent.findProperty('config_name', 'cluster');
  509. cluster.config_value = this.get('content.cluster.name');
  510. console.log("STEP8: the value of content cluster name: " + this.get('content.cluster.name'));
  511. this.get('clusterInfo').pushObject(Ember.Object.create(cluster));
  512. //hosts
  513. var newHostsCount = 0;
  514. var totalHostsCount = 0;
  515. var hosts = this.get('content.hosts');
  516. for (var hostName in hosts) {
  517. newHostsCount += ~~(!hosts[hostName].isInstalled);
  518. totalHostsCount++;
  519. }
  520. var totalHostsObj = this.rawContent.findProperty('config_name', 'hosts');
  521. totalHostsObj.config_value = totalHostsCount + ' (' + newHostsCount + ' new)';
  522. this.get('clusterInfo').pushObject(Em.Object.create(totalHostsObj));
  523. //repo
  524. if (['addHostController', 'addServiceController'].contains(this.get('content.controllerName'))) {
  525. this.loadRepoInfo();
  526. } else {
  527. // from install wizard
  528. var selectedStack = App.Stack.find().findProperty('isSelected');
  529. var allRepos = [];
  530. if (selectedStack && selectedStack.get('operatingSystems')) {
  531. selectedStack.get('operatingSystems').forEach(function (os) {
  532. if (os.get('isSelected')) {
  533. os.get('repositories').forEach(function(repo) {
  534. allRepos.push(Em.Object.create({
  535. base_url: repo.get('baseUrl'),
  536. os_type: repo.get('osType'),
  537. repo_id: repo.get('repoId')
  538. }));
  539. }, this);
  540. }
  541. }, this);
  542. }
  543. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  544. this.get('clusterInfo').set('repoInfo', allRepos);
  545. }
  546. },
  547. /**
  548. * Load repo info for add Service/Host wizard review page
  549. * @return {$.ajax|null}
  550. * @method loadRepoInfo
  551. */
  552. loadRepoInfo: function () {
  553. var nameVersionCombo = App.get('currentStackVersion').split('-');
  554. return App.ajax.send({
  555. name: 'cluster.load_repositories',
  556. sender: this,
  557. data: {
  558. stackName: nameVersionCombo[0],
  559. stackVersion: nameVersionCombo[1]
  560. },
  561. success: 'loadRepoInfoSuccessCallback',
  562. error: 'loadRepoInfoErrorCallback'
  563. });
  564. },
  565. /**
  566. * Save all repo base URL of all OS type to <code>repoInfo<code>
  567. * @param {object} data
  568. * @method loadRepoInfoSuccessCallback
  569. */
  570. loadRepoInfoSuccessCallback: function (data) {
  571. var allRepos = [];
  572. data.items.forEach(function (os) {
  573. os.repositories.forEach(function (repository) {
  574. allRepos.push(Em.Object.create({
  575. base_url: repository.Repositories.base_url,
  576. os_type: repository.Repositories.os_type,
  577. repo_id: repository.Repositories.repo_id
  578. }));
  579. });
  580. }, this);
  581. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  582. this.get('clusterInfo').set('repoInfo', allRepos);
  583. },
  584. /**
  585. * @param {object} request
  586. * @method loadRepoInfoErrorCallback
  587. */
  588. loadRepoInfoErrorCallback: function (request) {
  589. console.log('Error message is: ' + request.responseText);
  590. var allRepos = [];
  591. allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
  592. this.get('clusterInfo').set('repoInfo', allRepos);
  593. },
  594. /**
  595. * Load all info about services to <code>services</code> variable
  596. * @method loadServices
  597. */
  598. loadServices: function () {
  599. this.get('selectedServices').filterProperty('isHiddenOnSelectServicePage', false).forEach(function (service) {
  600. console.log('INFO: step8: Name of the service from getService function: ' + service.get('serviceName'));
  601. var serviceObj = Em.Object.create({
  602. service_name: service.get('serviceName'),
  603. display_name: service.get('displayNameOnSelectServicePage'),
  604. service_components: Em.A([])
  605. });
  606. service.get('serviceComponents').forEach(function (component) {
  607. // show clients for services that have only clients components
  608. if ((component.get('isClient') || component.get('isClientBehavior')) && !service.get('isClientOnlyService')) return;
  609. // skip components that was hide on assign master page
  610. if (component.get('isMaster') && !component.get('isShownOnInstallerAssignMasterPage')) return;
  611. // no HA component
  612. if (component.get('isHAComponentOnly')) return;
  613. var displayName;
  614. if (component.get('isClient')) {
  615. displayName = Em.I18n.t('common.clients')
  616. } else {
  617. // remove service name from component display name
  618. displayName = App.format.role(component.get('componentName')).replace(new RegExp('^' + service.get('serviceName') + '\\s', 'i'), '');
  619. }
  620. serviceObj.get('service_components').pushObject(Em.Object.create({
  621. component_name: component.get('isClient') ? Em.I18n.t('common.client').toUpperCase() : component.get('componentName'),
  622. display_name: displayName,
  623. component_value: this.assignComponentHosts(component)
  624. }));
  625. }, this);
  626. if (service.get('customReviewHandler')) {
  627. for (var displayName in service.get('customReviewHandler')) {
  628. serviceObj.get('service_components').pushObject(Em.Object.create({
  629. display_name: displayName,
  630. component_value: this.assignComponentHosts(Em.Object.create({
  631. customHandler: service.get('customReviewHandler.' + displayName)
  632. }))
  633. }));
  634. }
  635. }
  636. this.get('services').pushObject(serviceObj);
  637. }, this);
  638. },
  639. /**
  640. * Set <code>component_value</code> property to <code>component</code>
  641. * @param {Em.Object} component
  642. * @return {String}
  643. * @method assignComponentHosts
  644. */
  645. assignComponentHosts: function (component) {
  646. var componentValue;
  647. if (component.get('customHandler')) {
  648. componentValue = this[component.get('customHandler')].call(this, component);
  649. }
  650. else {
  651. if (component.get('isMaster')) {
  652. componentValue = this.getMasterComponentValue(component.get('componentName'));
  653. }
  654. else {
  655. console.log(' --- ---INFO: step8: NOT component isMaster');
  656. var componentName = component.get('isClient') ? Em.I18n.t('common.client').toUpperCase() : component.get('componentName');
  657. var hostsLength = this.get('content.slaveComponentHosts')
  658. .findProperty('componentName', componentName).hosts.length;
  659. componentValue = hostsLength + Em.I18n.t('installer.step8.host' + ((hostsLength > 1) ? 's' : ''));
  660. }
  661. }
  662. return componentValue;
  663. },
  664. getMasterComponentValue: function (componentName) {
  665. var masterComponents = this.get('content.masterComponentHosts');
  666. var hostsCount = masterComponents.filterProperty('component', componentName).length;
  667. return stringUtils.pluralize(hostsCount,
  668. masterComponents.findProperty('component', componentName).hostName,
  669. hostsCount + ' ' + Em.I18n.t('installer.step8.hosts'));
  670. },
  671. /**
  672. * Set dispalyed Hive DB value based on DB type
  673. * @param {Ember.Object} dbComponent
  674. * @method loadHiveDbValue
  675. */
  676. loadHiveDbValue: function () {
  677. var db,
  678. serviceConfigPreoprties = this.get('wizardController').getDBProperty('serviceConfigProperties'),
  679. hiveDb = serviceConfigPreoprties.findProperty('name', 'hive_database');
  680. if (hiveDb.value === 'New MySQL Database') {
  681. return 'MySQL (New Database)';
  682. } else if (hiveDb.value === 'New PostgreSQL Database') {
  683. return 'Postgres (New Database)';
  684. }
  685. else {
  686. if (hiveDb.value === 'Existing MySQL Database') {
  687. db = serviceConfigPreoprties.findProperty('name', 'hive_existing_mysql_database');
  688. return db.value + ' (' + hiveDb.value + ')';
  689. }
  690. else {
  691. if (hiveDb.value === Em.I18n.t('services.service.config.hive.oozie.postgresql')) {
  692. db = serviceConfigPreoprties.findProperty('name', 'hive_existing_postgresql_database');
  693. return db.value + ' (' + hiveDb.value + ')';
  694. }
  695. else { // existing oracle database
  696. db = serviceConfigPreoprties.findProperty('name', 'hive_existing_oracle_database');
  697. return db.value + ' (' + hiveDb.value + ')';
  698. }
  699. }
  700. }
  701. },
  702. /**
  703. * Set displayed HBase master value
  704. * @param {Object} hbaseMaster
  705. * @method loadHbaseMasterValue
  706. */
  707. loadHbaseMasterValue: function (hbaseMaster) {
  708. var hbaseHostName = this.get('content.masterComponentHosts').filterProperty('component', hbaseMaster.component_name);
  709. if (hbaseHostName.length == 1) {
  710. hbaseMaster.set('component_value', hbaseHostName[0].hostName);
  711. } else {
  712. hbaseMaster.set('component_value', hbaseHostName[0].hostName + " " + Em.I18n.t('installer.step8.other').format(hbaseHostName.length - 1));
  713. }
  714. },
  715. /**
  716. * Set displayed ZooKeeper Server value
  717. * @param {Object} serverComponent
  718. * @method loadZkServerValue
  719. */
  720. loadZkServerValue: function (serverComponent) {
  721. var zkHostNames = this.get('content.masterComponentHosts').filterProperty('component', serverComponent.component_name).length;
  722. var hostSuffix;
  723. if (zkHostNames === 1) {
  724. hostSuffix = Em.I18n.t('installer.step8.host');
  725. } else {
  726. hostSuffix = Em.I18n.t('installer.step8.hosts');
  727. }
  728. serverComponent.set('component_value', zkHostNames + hostSuffix);
  729. },
  730. /**
  731. * Set displayed Oozie DB value based on DB type
  732. * @param {Object} dbComponent
  733. * @method loadOozieDbValue
  734. */
  735. loadOozieDbValue: function () {
  736. var db, oozieDb = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_database');
  737. if (oozieDb.value === 'New Derby Database') {
  738. db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_derby_database');
  739. return db.value + ' (' + oozieDb.value + ')';
  740. }
  741. else {
  742. if (oozieDb.value === 'Existing MySQL Database') {
  743. db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_mysql_database');
  744. return db.value + ' (' + oozieDb.value + ')';
  745. }
  746. else {
  747. if (oozieDb.value === Em.I18n.t('services.service.config.hive.oozie.postgresql')) {
  748. db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_postgresql_database');
  749. return db.value + ' (' + oozieDb.value + ')';
  750. }
  751. else { // existing oracle database
  752. db = this.get('wizardController').getDBProperty('serviceConfigProperties').findProperty('name', 'oozie_existing_oracle_database');
  753. return db.value + ' (' + oozieDb.value + ')';
  754. }
  755. }
  756. }
  757. },
  758. /**
  759. * Set displayed Nagion Admin value
  760. * @param {Object} nagiosAdmin
  761. * @method loadNagiosAdminValue
  762. */
  763. loadNagiosAdminValue: function () {
  764. var config = this.get('content.serviceConfigProperties');
  765. var adminLoginName = config.findProperty('name', 'nagios_web_login');
  766. var adminEmail = config.findProperty('name', 'nagios_contact');
  767. return adminLoginName.value + ' / (' + adminEmail.value + ')';
  768. },
  769. /**
  770. * Onclick handler for <code>next</code> button
  771. * @method submit
  772. * @return {App.ModalPopup|null}
  773. */
  774. submit: function () {
  775. if (this.get('isSubmitDisabled')) return null;
  776. if ((this.get('content.controllerName') == 'addHostController') && this.get('securityEnabled')) {
  777. var self = this;
  778. return App.showConfirmationPopup(function () {
  779. self.submitProceed();
  780. }, Em.I18n.t('installer.step8.securityConfirmationPopupBody'));
  781. }
  782. else {
  783. return this.submitProceed();
  784. }
  785. },
  786. /**
  787. * Update configurations for installed services.
  788. * Do separated PUT-request for each siteName for each service
  789. *
  790. * @param {Array} fileNamesToUpdate - file names that should be updated
  791. * @method updateConfigurations
  792. */
  793. updateConfigurations: function (fileNamesToUpdate) {
  794. var configurationController = App.router.get('mainServiceInfoConfigsController');
  795. var configs = this.get('configs').slice(0);
  796. var configsMap = [];
  797. fileNamesToUpdate.forEach(function (fileName) {
  798. if (!fileName || /^(core)/.test(fileName)) return;
  799. var tagName = 'version' + (new Date).getTime();
  800. var configsToSave = configs.filterProperty('filename', fileName);
  801. configsToSave.forEach(function (item) {
  802. item.value = App.config.trimProperty(item, false);
  803. });
  804. configsMap.push(configurationController.createSiteObj(fileName.replace(".xml", ""), tagName, configsToSave));
  805. }, this);
  806. if (!configsMap.length) return;
  807. this.applyConfigurationsToCluster(configsMap);
  808. },
  809. /**
  810. * Prepare <code>ajaxQueue</code> and start to execute it
  811. * @method submitProceed
  812. */
  813. submitProceed: function () {
  814. var self = this;
  815. this.set('isSubmitDisabled', true);
  816. this.set('isBackBtnDisabled', true);
  817. if (this.get('content.controllerName') == 'addHostController') {
  818. App.router.get('addHostController').setLowerStepsDisable(4);
  819. }
  820. // checkpoint the cluster status on the server so that the user can resume from where they left off
  821. switch (this.get('content.controllerName')) {
  822. case 'installerController':
  823. App.clusterStatus.setClusterStatus({
  824. clusterName: this.get('clusterName'),
  825. clusterState: 'CLUSTER_DEPLOY_PREP_2',
  826. wizardControllerName: this.get('content.controllerName'),
  827. localdb: App.db.data
  828. });
  829. break;
  830. case 'addHostController':
  831. App.clusterStatus.setClusterStatus({
  832. clusterName: this.get('clusterName'),
  833. clusterState: 'ADD_HOSTS_DEPLOY_PREP_2',
  834. wizardControllerName: this.get('content.controllerName'),
  835. localdb: App.db.data
  836. });
  837. break;
  838. case 'addServiceController':
  839. App.clusterStatus.setClusterStatus({
  840. clusterName: this.get('clusterName'),
  841. clusterState: 'ADD_SERVICES_DEPLOY_PREP_2',
  842. wizardControllerName: this.get('content.controllerName'),
  843. localdb: App.db.data
  844. });
  845. break;
  846. default:
  847. break;
  848. }
  849. // delete any existing clusters to start from a clean slate
  850. // before creating a new cluster in install wizard
  851. // TODO: modify for multi-cluster support
  852. this.getExistingClusterNames().complete(function () {
  853. var clusterNames = self.get('clusterNames');
  854. if (self.get('content.controllerName') == 'installerController' && (!App.get('testMode')) && clusterNames.length) {
  855. self.deleteClusters(clusterNames);
  856. } else {
  857. self.deleteClustersCallback(null, null, {isLast: true});
  858. }
  859. });
  860. },
  861. /**
  862. * Get list of existing cluster names
  863. * @returns {object|null}
  864. * returns an array of existing cluster names.
  865. * returns an empty array if there are no existing clusters.
  866. * @method getExistingClusterNames
  867. */
  868. getExistingClusterNames: function () {
  869. return App.ajax.send({
  870. name: 'wizard.step8.existing_cluster_names',
  871. sender: this,
  872. success: 'getExistingClusterNamesSuccessCallBack',
  873. error: 'getExistingClusterNamesErrorCallback'
  874. });
  875. },
  876. /**
  877. * Save received list to <code>clusterNames</code>
  878. * @param {Object} data
  879. * @method getExistingClusterNamesSuccessCallBack
  880. */
  881. getExistingClusterNamesSuccessCallBack: function (data) {
  882. var clusterNames = data.items.mapProperty('Clusters.cluster_name');
  883. console.log("Got existing cluster names: " + clusterNames);
  884. this.set('clusterNames', clusterNames);
  885. },
  886. /**
  887. * If error appears, set <code>clusterNames</code> to <code>[]</code>
  888. * @method getExistingClusterNamesErrorCallback
  889. */
  890. getExistingClusterNamesErrorCallback: function () {
  891. console.log("Failed to get existing cluster names");
  892. this.set('clusterNames', []);
  893. },
  894. /**
  895. * Delete cluster by name
  896. * One request for one cluster!
  897. * @param {string[]} clusterNames
  898. * @method deleteClusters
  899. */
  900. deleteClusters: function (clusterNames) {
  901. clusterNames.forEach(function (clusterName, index) {
  902. App.ajax.send({
  903. name: 'common.delete.cluster',
  904. sender: this,
  905. data: {
  906. name: clusterName,
  907. isLast: index == clusterNames.length - 1
  908. },
  909. success: 'deleteClustersCallback',
  910. error: 'deleteClustersCallback'
  911. });
  912. }, this);
  913. },
  914. deleteClustersCallback: function (response, request, data) {
  915. if (data.isLast) {
  916. this.createCluster();
  917. this.createSelectedServices();
  918. if (this.get('content.controllerName') !== 'addHostController') {
  919. if (this.get('wizardController').getDBProperty('fileNamesToUpdate') && this.get('wizardController').getDBProperty('fileNamesToUpdate').length) {
  920. this.updateConfigurations(this.get('wizardController').getDBProperty('fileNamesToUpdate'));
  921. }
  922. this.createConfigurations();
  923. this.applyConfigurationsToCluster(this.get('serviceConfigTags'));
  924. }
  925. this.createComponents();
  926. this.registerHostsToCluster();
  927. this.createConfigurationGroups();
  928. this.createMasterHostComponents();
  929. this.createSlaveAndClientsHostComponents();
  930. if (this.get('content.controllerName') === 'addServiceController') {
  931. this.createAdditionalClientComponents();
  932. }
  933. this.createAdditionalHostComponents();
  934. this.set('ajaxQueueLength', this.get('ajaxRequestsQueue.queue.length'));
  935. this.get('ajaxRequestsQueue').start();
  936. }
  937. },
  938. /**
  939. * *******************************************************************
  940. * The following create* functions are called upon submitting Step 8.
  941. * *******************************************************************
  942. */
  943. /**
  944. * Create cluster using selected stack version
  945. * Queued request
  946. * @method createCluster
  947. */
  948. createCluster: function () {
  949. if (this.get('content.controllerName') !== 'installerController') return;
  950. var stackVersion = (this.get('content.installOptions.localRepo')) ? App.currentStackVersion.replace(/(-\d+(\.\d)*)/ig, "Local$&") : App.currentStackVersion;
  951. this.addRequestToAjaxQueue({
  952. name: 'wizard.step8.create_cluster',
  953. data: {
  954. data: JSON.stringify({ "Clusters": {"version": stackVersion }})
  955. },
  956. success: 'createClusterSuccess'
  957. });
  958. },
  959. createClusterSuccess: function (data, xhr, params) {
  960. App.set('clusterName', params.cluster)
  961. },
  962. /**
  963. * Create selected to install services
  964. * Queued request
  965. * Skipped if no services where selected!
  966. * @method createSelectedServices
  967. */
  968. createSelectedServices: function () {
  969. var data = this.createSelectedServicesData();
  970. if (!data.length) return;
  971. this.addRequestToAjaxQueue({
  972. name: 'wizard.step8.create_selected_services',
  973. data: {
  974. data: JSON.stringify(data)
  975. }
  976. });
  977. },
  978. /**
  979. * Format data for <code>createSelectedServices</code> request
  980. * @returns {Object[]}
  981. * @method createSelectedServicesData
  982. */
  983. createSelectedServicesData: function () {
  984. return this.get('selectedServices').map(function (_service) {
  985. return {"ServiceInfo": { "service_name": _service.get('serviceName') }};
  986. });
  987. },
  988. /**
  989. * Create components for selected services
  990. * Queued requests
  991. * One request for each service!
  992. * @method createComponents
  993. */
  994. createComponents: function () {
  995. var serviceComponents = App.StackServiceComponent.find();
  996. this.get('selectedServices').forEach(function (_service) {
  997. var serviceName = _service.get('serviceName');
  998. var componentsData = serviceComponents.filterProperty('serviceName', serviceName).map(function (_component) {
  999. return { "ServiceComponentInfo": { "component_name": _component.get('componentName') } };
  1000. });
  1001. // Service must be specified in terms of a query for creating multiple components at the same time.
  1002. // See AMBARI-1018.
  1003. this.addRequestToAjaxQueue({
  1004. name: 'wizard.step8.create_components',
  1005. data: {
  1006. data: JSON.stringify({"components": componentsData}),
  1007. serviceName: serviceName
  1008. }
  1009. });
  1010. }, this);
  1011. },
  1012. /**
  1013. * Error callback for new service component request
  1014. * So, if component doesn't exist we should create it
  1015. * @param {object} request
  1016. * @param {object} ajaxOptions
  1017. * @param {string} error
  1018. * @param {object} opt
  1019. * @param {object} params
  1020. * @method newServiceComponentErrorCallback
  1021. */
  1022. newServiceComponentErrorCallback: function (request, ajaxOptions, error, opt, params) {
  1023. this.addRequestToAjaxQueue({
  1024. name: 'wizard.step8.create_components',
  1025. data: {
  1026. serviceName: params.serviceName,
  1027. data: JSON.stringify({
  1028. "components": [
  1029. {
  1030. "ServiceComponentInfo": {
  1031. "component_name": params.componentName
  1032. }
  1033. }
  1034. ]
  1035. })
  1036. }
  1037. });
  1038. },
  1039. /**
  1040. * Register hosts
  1041. * Queued request
  1042. * @method registerHostsToCluster
  1043. */
  1044. registerHostsToCluster: function () {
  1045. var data = this.createRegisterHostData();
  1046. if (!data.length) return;
  1047. this.addRequestToAjaxQueue({
  1048. name: 'wizard.step8.register_host_to_cluster',
  1049. data: {
  1050. data: JSON.stringify(data)
  1051. }
  1052. });
  1053. },
  1054. /**
  1055. * Format request-data for <code>registerHostsToCluster</code>
  1056. * @returns {Object}
  1057. * @method createRegisterHostData
  1058. */
  1059. createRegisterHostData: function () {
  1060. return this.getRegisteredHosts().filterProperty('isInstalled', false).map(function (host) {
  1061. return {"Hosts": { "host_name": host.hostName}};
  1062. });
  1063. },
  1064. /**
  1065. * Register new master components
  1066. * @uses registerHostsToComponent
  1067. * @method createMasterHostComponents
  1068. */
  1069. createMasterHostComponents: function () {
  1070. // create master components for only selected services.
  1071. var selectedMasterComponents = this.get('content.masterComponentHosts').filter(function (_component) {
  1072. return this.get('selectedServices').mapProperty('serviceName').contains(_component.serviceId)
  1073. }, this);
  1074. selectedMasterComponents.mapProperty('component').uniq().forEach(function (component) {
  1075. var hostNames = selectedMasterComponents.filterProperty('component', component).filterProperty('isInstalled', false).mapProperty('hostName');
  1076. this.registerHostsToComponent(hostNames, component);
  1077. }, this);
  1078. },
  1079. getClientsToMasterMap: function () {
  1080. var clientNames = App.StackServiceComponent.find().filterProperty('isClient').mapProperty('componentName'),
  1081. clientsMap = {},
  1082. dependedComponents = App.StackServiceComponent.find().filterProperty('isMaster');
  1083. clientNames.forEach(function (clientName) {
  1084. clientsMap[clientName] = Em.A([]);
  1085. dependedComponents.forEach(function (component) {
  1086. if (component.get('dependencies').mapProperty('componentName').contains(clientName)) clientsMap[clientName].push(component.get('componentName'));
  1087. });
  1088. if (!clientsMap[clientName].length) delete clientsMap[clientName];
  1089. });
  1090. return clientsMap;
  1091. },
  1092. /**
  1093. * Register slave components and clients
  1094. * @uses registerHostsToComponent
  1095. * @method createSlaveAndClientsHostComponents
  1096. */
  1097. createSlaveAndClientsHostComponents: function () {
  1098. var masterHosts = this.get('content.masterComponentHosts');
  1099. var slaveHosts = this.get('content.slaveComponentHosts');
  1100. var clients = this.get('content.clients').filterProperty('isInstalled', false);
  1101. /**
  1102. * Determines on which hosts client should be installed (based on availability of master components on hosts)
  1103. * @type {Object}
  1104. * Format:
  1105. * <code>
  1106. * {
  1107. * CLIENT1: Em.A([MASTER1, MASTER2, ...]),
  1108. * CLIENT2: Em.A([MASTER3, MASTER1, ...])
  1109. * ...
  1110. * }
  1111. * </code>
  1112. */
  1113. var clientsToMasterMap = this.getClientsToMasterMap();
  1114. slaveHosts.forEach(function (_slave) {
  1115. if (_slave.componentName !== 'CLIENT') {
  1116. var hostNames = _slave.hosts.filterProperty('isInstalled', false).mapProperty('hostName');
  1117. this.registerHostsToComponent(hostNames, _slave.componentName);
  1118. }
  1119. else {
  1120. clients.forEach(function (_client) {
  1121. var hostNames = _slave.hosts.mapProperty('hostName');
  1122. // The below logic to install clients to existing/New master hosts should not be applied to Add Host wizard.
  1123. // This is with the presumption that Add Host controller does not add any new Master component to the cluster
  1124. if (this.get('content.controllerName') !== 'addHostController') {
  1125. if (clientsToMasterMap[_client.component_name]) {
  1126. clientsToMasterMap[_client.component_name].forEach(function (componentName) {
  1127. masterHosts.filterProperty('component', componentName).forEach(function (_masterHost) {
  1128. hostNames.pushObject(_masterHost.hostName);
  1129. });
  1130. });
  1131. }
  1132. }
  1133. hostNames = hostNames.uniq();
  1134. this.registerHostsToComponent(hostNames, _client.component_name);
  1135. }, this);
  1136. }
  1137. }, this);
  1138. },
  1139. /**
  1140. * This function is specific to addServiceController
  1141. * Newly introduced master components requires some existing client components to be hosted along with them
  1142. */
  1143. createAdditionalClientComponents: function () {
  1144. var masterHosts = this.get('content.masterComponentHosts');
  1145. var clientsToMasterMap = this.getClientsToMasterMap();
  1146. var installedClients = [];
  1147. // Get all the installed Client components
  1148. this.get('content.services').filterProperty('isInstalled').forEach(function (_service) {
  1149. var serviceClients = App.StackServiceComponent.find().filterProperty('serviceName', _service.get('serviceName')).filterProperty('isClient');
  1150. serviceClients.forEach(function (client) {
  1151. installedClients.push(client.get('componentName'));
  1152. }, this);
  1153. }, this);
  1154. // Check if there is a dependency for being co-hosted between existing client and selected new master
  1155. installedClients.forEach(function (_clientName) {
  1156. if (clientsToMasterMap[_clientName]) {
  1157. var hostNames = [];
  1158. clientsToMasterMap[_clientName].forEach(function (componentName) {
  1159. masterHosts.filterProperty('component', componentName).filterProperty('isInstalled', false).forEach(function (_masterHost) {
  1160. hostNames.pushObject(_masterHost.hostName);
  1161. }, this);
  1162. }, this);
  1163. hostNames = hostNames.uniq();
  1164. if (hostNames.length > 0) {
  1165. this.get('content.additionalClients').pushObject({hostNames: hostNames, componentName: _clientName});
  1166. // If a dependency for being co-hosted is derived between existing client and selected new master but that
  1167. // dependency is already satisfied in the cluster then disregard the derived dependency
  1168. this.removeClientsFromList(_clientName, hostNames);
  1169. this.registerHostsToComponent(hostNames, _clientName);
  1170. }
  1171. }
  1172. }, this);
  1173. },
  1174. /**
  1175. *
  1176. * @param clientName
  1177. * @param hostList
  1178. */
  1179. removeClientsFromList: function (clientName, hostList) {
  1180. var clientHosts = [];
  1181. var installedHosts = this.get('content.hosts');
  1182. for (var hostName in installedHosts) {
  1183. if (installedHosts[hostName].isInstalled) {
  1184. if (installedHosts[hostName].hostComponents.mapProperty('HostRoles.component_name').contains(clientName)) {
  1185. clientHosts.push(hostName);
  1186. }
  1187. }
  1188. }
  1189. if (clientHosts.length > 0) {
  1190. clientHosts.forEach(function (hostName) {
  1191. if (hostList.contains(hostName)) {
  1192. hostList.splice(hostList.indexOf(hostName), 1);
  1193. }
  1194. }, this);
  1195. }
  1196. },
  1197. /**
  1198. * Register additional components
  1199. * Based on availability of some services
  1200. * @uses registerHostsToComponent
  1201. * @method createAdditionalHostComponents
  1202. */
  1203. createAdditionalHostComponents: function () {
  1204. var masterHosts = this.get('content.masterComponentHosts');
  1205. // add MySQL Server if Hive is selected
  1206. // add Ganglia Monitor (Slave) to all hosts if Ganglia service is selected
  1207. var gangliaService = this.get('content.services').filterProperty('isSelected').findProperty('serviceName', 'GANGLIA');
  1208. if (gangliaService) {
  1209. var hosts = this.getRegisteredHosts();
  1210. if (gangliaService.get('isInstalled')) {
  1211. hosts = hosts.filterProperty('isInstalled', false);
  1212. }
  1213. if (hosts.length) {
  1214. this.registerHostsToComponent(hosts.mapProperty('hostName'), 'GANGLIA_MONITOR');
  1215. }
  1216. }
  1217. var hiveService = this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false).findProperty('serviceName', 'HIVE');
  1218. if (hiveService) {
  1219. var hiveDb = this.get('content.serviceConfigProperties').findProperty('name', 'hive_database');
  1220. if (hiveDb.value == "New MySQL Database") {
  1221. this.registerHostsToComponent(masterHosts.filterProperty('component', 'HIVE_SERVER').mapProperty('hostName'), 'MYSQL_SERVER');
  1222. } else if (hiveDb.value === "New PostgreSQL Database") {
  1223. this.registerHostsToComponent(masterHosts.filterProperty('component', 'HIVE_SERVER').mapProperty('hostName'), 'POSTGRESQL_SERVER');
  1224. }
  1225. }
  1226. },
  1227. /**
  1228. * Register component to hosts
  1229. * Queued request
  1230. * @param {String[]} hostNames
  1231. * @param {String} componentName
  1232. * @method registerHostsToComponent
  1233. */
  1234. registerHostsToComponent: function (hostNames, componentName) {
  1235. if (!hostNames.length) return;
  1236. var queryStr = '';
  1237. hostNames.forEach(function (hostName) {
  1238. queryStr += 'Hosts/host_name=' + hostName + '|';
  1239. });
  1240. //slice off last symbol '|'
  1241. queryStr = queryStr.slice(0, -1);
  1242. var data = {
  1243. "RequestInfo": {
  1244. "query": queryStr
  1245. },
  1246. "Body": {
  1247. "host_components": [
  1248. {
  1249. "HostRoles": {
  1250. "component_name": componentName
  1251. }
  1252. }
  1253. ]
  1254. }
  1255. };
  1256. this.addRequestToAjaxQueue({
  1257. name: 'wizard.step8.register_host_to_component',
  1258. data: {
  1259. data: JSON.stringify(data)
  1260. }
  1261. });
  1262. },
  1263. /**
  1264. * Compare generated config object with current configs that were filled
  1265. * on "Customize Services" page.
  1266. *
  1267. * @param {Object} properties - generated by createSiteObj|createCoreSiteObj
  1268. * @param {Array} configs - current configs to compare
  1269. * @return {Boolean}
  1270. * @method isConfigsChanged
  1271. **/
  1272. isConfigsChanged: function (properties, configs) {
  1273. var isChanged = false;
  1274. for (var property in properties) {
  1275. var config = configs.findProperty('name', property);
  1276. // if config not found then it's looks like a new config
  1277. if (!config) {
  1278. isChanged = true;
  1279. } else {
  1280. if (!config.hasInitialValue || config.isNotDefaultValue) {
  1281. isChanged = true;
  1282. }
  1283. }
  1284. }
  1285. return isChanged;
  1286. },
  1287. /**
  1288. * Create config objects for cluster and services
  1289. * @method createConfigurations
  1290. */
  1291. createConfigurations: function () {
  1292. var selectedServices = this.get('selectedServices');
  1293. var coreSiteObject = this.createCoreSiteObj();
  1294. var tag = 'version1';
  1295. var clusterSiteObj = this.createSiteObj('cluster-env', tag);
  1296. if (this.get('content.controllerName') == 'installerController') {
  1297. this.get('serviceConfigTags').pushObject(clusterSiteObj);
  1298. }
  1299. if (this.get('content.controllerName') == 'addServiceController') {
  1300. tag = 'version' + (new Date).getTime();
  1301. coreSiteObject.tag = tag;
  1302. var coreSiteConfigs = this.get('configs').filterProperty('filename', 'core-site.xml');
  1303. if (this.isConfigsChanged(coreSiteObject.properties, coreSiteConfigs)) {
  1304. this.get('serviceConfigTags').pushObject(coreSiteObject);
  1305. }
  1306. }
  1307. selectedServices.forEach(function (service) {
  1308. Object.keys(service.get('configTypes')).forEach(function (type) {
  1309. if (!this.get('serviceConfigTags').someProperty('type', type)) {
  1310. var serviceVersionNotes = Em.I18n.t('dashboard.configHistory.table.notes.default').format(service.get('displayName'));
  1311. if (service.get('serviceName') === 'MAPREDUCE' && (type === 'capacity-scheduler' || type === 'mapred-queue-acls')) {
  1312. return;
  1313. } else if (type === 'core-site') {
  1314. coreSiteObject.service_config_version_note = serviceVersionNotes
  1315. this.get('serviceConfigTags').pushObject(coreSiteObject);
  1316. } else if (type === 'storm-site') {
  1317. var obj = this.createStormSiteObj(tag);
  1318. obj.service_config_version_note = serviceVersionNotes;
  1319. this.get('serviceConfigTags').pushObject(obj);
  1320. } else {
  1321. var obj = this.createSiteObj(type, tag);
  1322. obj.service_config_version_note = serviceVersionNotes;
  1323. this.get('serviceConfigTags').pushObject(obj);
  1324. }
  1325. }
  1326. }, this);
  1327. }, this);
  1328. },
  1329. /**
  1330. * Send <code>serviceConfigTags</code> to server
  1331. * Queued request
  1332. * One request for each service config tag
  1333. * @param serviceConfigTags
  1334. * @method applyConfigurationsToCluster
  1335. */
  1336. applyConfigurationsToCluster: function (serviceConfigTags) {
  1337. var allServices = this.get('installedServices').concat(this.get('selectedServices'));
  1338. var allConfigData = [];
  1339. allServices.forEach(function (service) {
  1340. var serviceConfigData = [];
  1341. Object.keys(service.get('configTypesRendered')).forEach(function (type) {
  1342. var serviceConfigTag = serviceConfigTags.findProperty('type', type);
  1343. if (serviceConfigTag) {
  1344. serviceConfigData.pushObject(serviceConfigTag);
  1345. }
  1346. }, this);
  1347. if (serviceConfigData.length) {
  1348. allConfigData.pushObject(JSON.stringify({
  1349. Clusters: {
  1350. desired_config: serviceConfigData
  1351. }
  1352. }));
  1353. }
  1354. }, this);
  1355. var clusterConfig = serviceConfigTags.findProperty('type', 'cluster-env');
  1356. if (clusterConfig) {
  1357. allConfigData.pushObject(JSON.stringify({
  1358. Clusters: {
  1359. desired_config: [clusterConfig]
  1360. }
  1361. }));
  1362. }
  1363. this.addRequestToAjaxQueue({
  1364. name: 'common.across.services.configurations',
  1365. data: {
  1366. data: '[' + allConfigData.toString() + ']'
  1367. }
  1368. });
  1369. },
  1370. /**
  1371. * Create and update config groups
  1372. * @method createConfigurationGroups
  1373. */
  1374. createConfigurationGroups: function () {
  1375. var configGroups = this.get('content.configGroups').filterProperty('isDefault', false);
  1376. var clusterName = this.get('clusterName');
  1377. var sendData = [];
  1378. var updateData = [];
  1379. var serviceConfigController = App.router.get('mainServiceInfoConfigsController');
  1380. var timeTag = (new Date).getTime();
  1381. var groupsToDelete = App.router.get(this.get('content.controllerName')).getDBProperty('groupsToDelete');
  1382. if (groupsToDelete && groupsToDelete.length > 0) {
  1383. this.removeInstalledServicesConfigurationGroups(groupsToDelete);
  1384. }
  1385. configGroups.forEach(function (configGroup) {
  1386. var groupConfigs = [];
  1387. var groupData = {
  1388. "cluster_name": clusterName,
  1389. "group_name": configGroup.name,
  1390. "tag": configGroup.service.id,
  1391. "description": configGroup.description,
  1392. "hosts": [],
  1393. "desired_configs": []
  1394. };
  1395. configGroup.hosts.forEach(function (hostName) {
  1396. groupData.hosts.push({"host_name": hostName});
  1397. });
  1398. // get properties that was created for non-default config group
  1399. configGroup.properties = configGroup.properties.concat(this.get('customNonDefaultGroupConfigs').filterProperty('group', configGroup.name));
  1400. //wrap properties into Em.Object to make them compatible with buildGroupDesiredConfigs method
  1401. configGroup.properties.forEach(function (property) {
  1402. groupConfigs.push(Em.Object.create(property));
  1403. });
  1404. groupData.desired_configs = serviceConfigController.buildGroupDesiredConfigs.call(serviceConfigController, groupConfigs, timeTag);
  1405. // check for group from installed service
  1406. if (configGroup.isForInstalledService === true) {
  1407. // if group is a new one, create it
  1408. if (!configGroup.id) {
  1409. sendData.push({"ConfigGroup": groupData});
  1410. } else if (configGroup.isForUpdate){
  1411. // update an existing group
  1412. groupData.id = configGroup.id;
  1413. updateData.push({"ConfigGroup": groupData});
  1414. }
  1415. } else {
  1416. sendData.push({"ConfigGroup": groupData});
  1417. }
  1418. //each group should have unique tag to prevent overriding configs from common sites
  1419. timeTag++;
  1420. }, this);
  1421. if (sendData.length > 0) {
  1422. this.applyConfigurationGroups(sendData);
  1423. }
  1424. if (updateData.length > 0) {
  1425. this.applyInstalledServicesConfigurationGroup(updateData);
  1426. }
  1427. },
  1428. /**
  1429. * Create new config groups request
  1430. * Queued request
  1431. * @param {Object[]} sendData
  1432. * @method applyConfigurationGroups
  1433. */
  1434. applyConfigurationGroups: function (sendData) {
  1435. this.addRequestToAjaxQueue({
  1436. name: 'wizard.step8.apply_configuration_groups',
  1437. data: {
  1438. data: JSON.stringify(sendData)
  1439. }
  1440. });
  1441. },
  1442. /**
  1443. * Update existed config groups
  1444. * Separated request for each group
  1445. * @param {Object[]} updateData
  1446. * @method applyInstalledServicesConfigurationGroup
  1447. */
  1448. applyInstalledServicesConfigurationGroup: function (updateData) {
  1449. updateData.forEach(function (item) {
  1450. App.router.get('mainServiceInfoConfigsController').putConfigGroupChanges(item);
  1451. });
  1452. },
  1453. /**
  1454. * Delete selected config groups
  1455. * @param {Object[]} groupsToDelete
  1456. * @method removeInstalledServicesConfigurationGroups
  1457. */
  1458. removeInstalledServicesConfigurationGroups: function (groupsToDelete) {
  1459. groupsToDelete.forEach(function (item) {
  1460. App.config.deleteConfigGroup(Em.Object.create(item));
  1461. });
  1462. },
  1463. /**
  1464. * proxyuser configs which depend on service
  1465. */
  1466. optionalCoreSiteConfigs: [
  1467. {
  1468. serviceName: 'OOZIE',
  1469. user: 'oozie_user'
  1470. },
  1471. {
  1472. serviceName: 'HIVE',
  1473. user: 'hive_user'
  1474. },
  1475. {
  1476. serviceName: 'HIVE',
  1477. user: 'hcat_user'
  1478. },
  1479. {
  1480. serviceName: 'FALCON',
  1481. user: 'falcon_user'
  1482. }
  1483. ],
  1484. /**
  1485. * push proxyuser properties to core-site if they required by dependencies
  1486. * @param coreSiteObj
  1487. * @param installedAndSelectedServices
  1488. * @return {Object}
  1489. */
  1490. resolveProxyuserDependecies: function (coreSiteObj, installedAndSelectedServices) {
  1491. var coreSiteProperties = {};
  1492. var optionalCoreSiteConfigs = this.get('optionalCoreSiteConfigs');
  1493. var proxyuserGroup = this.get('configs').findProperty('name', 'proxyuser_group');
  1494. coreSiteObj.forEach(function (_coreSiteObj) {
  1495. //proxyuser_group property should be added only if proxyuser properties are used
  1496. if (_coreSiteObj.name === proxyuserGroup.name) return;
  1497. // exclude some configs if service wasn't selected
  1498. var addProperty = optionalCoreSiteConfigs.every(function (config) {
  1499. var userValue = this.get('configs').someProperty('name', config.user) ? this.get('configs').findProperty('name', config.user).value : null
  1500. return (installedAndSelectedServices.someProperty('serviceName', config.serviceName) ||
  1501. (_coreSiteObj.name != 'hadoop.proxyuser.' + userValue + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + userValue + '.groups'))
  1502. }, this);
  1503. if (addProperty) {
  1504. coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
  1505. }
  1506. }, this);
  1507. if (!App.isEmptyObject(coreSiteProperties) && proxyuserGroup) {
  1508. coreSiteProperties[proxyuserGroup.name] = proxyuserGroup.value;
  1509. }
  1510. return coreSiteProperties;
  1511. },
  1512. /**
  1513. * Create Core Site object
  1514. * @returns {{type: string, tag: string, properties: {}}}
  1515. * @method createCoreSiteObj
  1516. */
  1517. createCoreSiteObj: function () {
  1518. var installedAndSelectedServices = Em.A([]);
  1519. installedAndSelectedServices.pushObjects(this.get('installedServices'));
  1520. installedAndSelectedServices.pushObjects(this.get('selectedServices'));
  1521. var coreSiteObj = this.get('configs').filterProperty('filename', 'core-site.xml'),
  1522. coreSiteProperties = this.resolveProxyuserDependecies(coreSiteObj, installedAndSelectedServices),
  1523. isGLUSTERFSSelected = installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
  1524. coreSiteObj.forEach(function (_coreSiteObj) {
  1525. if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
  1526. coreSiteProperties[_coreSiteObj.name] =
  1527. this.get('configs').someProperty('name', 'fs_glusterfs_default_name') ?
  1528. this.get('configs').findProperty('name', 'fs_glusterfs_default_name').value : null;
  1529. }
  1530. if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
  1531. coreSiteProperties[_coreSiteObj.name] =
  1532. this.get('configs').someProperty('name', 'glusterfs_defaultFS_name') ?
  1533. this.get('configs').findProperty('name', 'glusterfs_defaultFS_name').value : null;
  1534. }
  1535. }, this);
  1536. var attributes = App.router.get('mainServiceInfoConfigsController').getConfigAttributes(coreSiteObj);
  1537. var configObj = {"type": "core-site", "tag": "version1", "properties": coreSiteProperties};
  1538. if (attributes) {
  1539. configObj['properties_attributes'] = attributes;
  1540. }
  1541. return configObj;
  1542. },
  1543. /**
  1544. * Create siteObj for custom service with it own configs
  1545. * @param {string} site
  1546. * @param tag
  1547. * @returns {{type: string, tag: string, properties: {}}}
  1548. * @method createSiteObj
  1549. */
  1550. createSiteObj: function (site, tag) {
  1551. var properties = {};
  1552. var configs = this.get('configs').filterProperty('filename', site + '.xml');
  1553. var attributes = App.router.get('mainServiceInfoConfigsController').getConfigAttributes(configs);
  1554. configs.forEach(function (_configProperty) {
  1555. var heapsizeExceptions = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize'];
  1556. // do not pass any globals whose name ends with _host or _hosts
  1557. if (_configProperty.isRequiredByAgent !== false) {
  1558. // append "m" to JVM memory options except for heapsizeExtensions
  1559. if (/_heapsize|_newsize|_maxnewsize|_permsize|_maxpermsize$/.test(_configProperty.name) && !heapsizeExceptions.contains(_configProperty.name) && !(_configProperty.value).endsWith("m")) {
  1560. properties[_configProperty.name] = _configProperty.value + "m";
  1561. } else {
  1562. properties[_configProperty.name] = _configProperty.value;
  1563. }
  1564. }
  1565. }, this);
  1566. var configObj = {"type": site, "tag": tag, "properties": properties };
  1567. if (attributes) {
  1568. configObj['properties_attributes'] = attributes;
  1569. }
  1570. return configObj;
  1571. },
  1572. /**
  1573. * Create site obj for Storm
  1574. * Some config-properties should be modified in custom way
  1575. * @param tag
  1576. * @returns {{type: string, tag: string, properties: {}}}
  1577. * @method createStormSiteObj
  1578. */
  1579. createStormSiteObj: function (tag) {
  1580. var configs = this.get('configs').filterProperty('filename', 'storm-site.xml');
  1581. var stormProperties = {};
  1582. configs.forEach(function (_configProperty) {
  1583. if (_configProperty.name == "storm.zookeeper.servers") {
  1584. stormProperties[_configProperty.name] = JSON.stringify(_configProperty.value).replace(/"/g, "'");
  1585. } else {
  1586. stormProperties[_configProperty.name] = _configProperty.value;
  1587. }
  1588. }, this);
  1589. return {type: 'storm-site', tag: tag, properties: stormProperties};
  1590. },
  1591. /**
  1592. * Navigate to next step after all requests are sent
  1593. * @method ajaxQueueFinished
  1594. */
  1595. ajaxQueueFinished: function () {
  1596. console.log('everything is loaded');
  1597. App.router.send('next');
  1598. },
  1599. /**
  1600. * We need to do a lot of ajax calls async in special order. To do this,
  1601. * generate array of ajax objects and then send requests step by step. All
  1602. * ajax objects are stored in <code>ajaxRequestsQueue</code>
  1603. *
  1604. * @param {Object} params object with ajax-request parameters like url, type, data etc
  1605. * @method addRequestToAjaxQueue
  1606. */
  1607. addRequestToAjaxQueue: function (params) {
  1608. if (App.get('testMode')) return;
  1609. params = jQuery.extend({
  1610. sender: this,
  1611. error: 'ajaxQueueRequestErrorCallback'
  1612. }, params);
  1613. params.data['cluster'] = this.get('clusterName');
  1614. this.get('ajaxRequestsQueue').addRequest(params);
  1615. },
  1616. /**
  1617. * Error callback for each queued ajax-request
  1618. * @param {object} xhr
  1619. * @param {string} status
  1620. * @param {string} error
  1621. * @method ajaxQueueRequestErrorCallback
  1622. */
  1623. ajaxQueueRequestErrorCallback: function (xhr, status, error) {
  1624. var responseText = JSON.parse(xhr.responseText);
  1625. var controller = App.router.get(App.clusterStatus.wizardControllerName);
  1626. controller.registerErrPopup(Em.I18n.t('common.error'), responseText.message);
  1627. this.set('hasErrorOccurred', true);
  1628. // an error will break the ajax call chain and allow submission again
  1629. this.set('isSubmitDisabled', false);
  1630. this.set('isBackBtnDisabled', false);
  1631. App.router.get(this.get('content.controllerName')).setStepsEnable();
  1632. }
  1633. });