step5_controller.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageController.extend({
  20. commands: ['stopAllServices', 'installNameNode', 'installJournalNodes', 'startJournalNodes', 'disableSNameNode', 'reconfigureHDFS'],
  21. stopAllServices: function () {
  22. App.ajax.send({
  23. name: 'admin.high_availability.stop_all_services',
  24. sender: this,
  25. success: 'startPolling',
  26. error: 'onTaskError'
  27. });
  28. },
  29. installNameNode: function () {
  30. var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode').hostName;
  31. this.createComponent('NAMENODE', hostName);
  32. },
  33. installJournalNodes: function () {
  34. var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
  35. this.createComponent('JOURNALNODE', hostNames);
  36. },
  37. startJournalNodes: function () {
  38. var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
  39. this.startComponent('JOURNALNODE', hostNames);
  40. },
  41. disableSNameNode: function () {
  42. var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
  43. App.ajax.send({
  44. name: 'admin.high_availability.maintenance_mode',
  45. sender: this,
  46. data: {
  47. hostName: hostName,
  48. componentName: 'SECONDARY_NAMENODE'
  49. },
  50. success: 'onTaskCompleted',
  51. error: 'onTaskError'
  52. });
  53. },
  54. reconfigureHDFS: function () {
  55. var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
  56. this.installComponent('HDFS_CLIENT', hostNames);
  57. }
  58. });