ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: AMBARI-7756 Oozie server start fails (dsen)
Date Mon, 13 Oct 2014 17:14:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 e4743acd6 -> 57c4d722f


AMBARI-7756 Oozie server start fails (dsen)


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

Branch: refs/heads/branch-1.7.0
Commit: 57c4d722fc5df00142db57cadbceff8b11bb58da
Parents: e4743ac
Author: Dmytro Sen <dsen@hortonworks.com>
Authored: Mon Oct 13 20:07:20 2014 +0300
Committer: Dmytro Sen <dsen@hortonworks.com>
Committed: Mon Oct 13 20:11:39 2014 +0300

----------------------------------------------------------------------
 .../2.0.6/services/HDFS/package/scripts/hdfs.py |  9 ++++
 .../python/stacks/2.0.6/HDFS/test_datanode.py   | 16 ++++++
 .../stacks/2.0.6/HDFS/test_journalnode.py       | 16 ++++++
 .../python/stacks/2.0.6/HDFS/test_namenode.py   | 16 ++++++
 .../python/stacks/2.0.6/HDFS/test_snamenode.py  | 16 ++++++
 .../test/python/stacks/2.0.6/HDFS/test_zkfc.py  | 16 ++++++
 .../controllers/main/service/add_controller.js  | 24 ++++++---
 .../app/controllers/wizard/step8_controller.js  | 14 ++++-
 .../app/controllers/wizard/step9_controller.js  |  7 ++-
 .../main/service/add_controller_test.js         | 26 +++++++++
 .../test/controllers/wizard/step8_test.js       | 55 ++++++++++++++++++++
 11 files changed, 206 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs.py
index 9985e32..23b52c9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs.py
@@ -58,6 +58,15 @@ def hdfs(name=None):
             group=params.user_group
   )
 
+  XmlConfig("core-site.xml",
+            conf_dir=params.hadoop_conf_dir,
+            configurations=params.config['configurations']['core-site'],
+            configuration_attributes=params.config['configuration_attributes']['core-site'],
+            owner=params.hdfs_user,
+            group=params.user_group,
+            mode=0644
+  )
+
   File(os.path.join(params.hadoop_conf_dir, 'slaves'),
        owner=tc_owner,
        content=Template("slaves.j2")

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
index f07d0aa..957f4c1 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
@@ -291,6 +291,14 @@ class TestDatanode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'hdfs',
@@ -323,6 +331,14 @@ class TestDatanode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+    )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
index 29891aa..99e127e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
@@ -160,6 +160,14 @@ class TestJournalnode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'hdfs',
@@ -184,6 +192,14 @@ class TestJournalnode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+    )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index 11310df..b2dcc46 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -449,6 +449,14 @@ class TestNamenode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'hdfs',
@@ -474,6 +482,14 @@ class TestNamenode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py
index 01f22e0..2020a6b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py
@@ -175,6 +175,14 @@ class TestSNamenode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'hdfs',
@@ -200,6 +208,14 @@ class TestSNamenode(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
index 2f7d4b9..d65b42a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
@@ -42,6 +42,14 @@ class TestZkfc(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+                              )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'hdfs',
@@ -109,6 +117,14 @@ class TestZkfc(RMFTestCase):
                               configurations = self.getConfig()['configurations']['hdfs-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['hdfs-site']
                               )
+    self.assertResourceCalled('XmlConfig', 'core-site.xml',
+                              owner = 'hdfs',
+                              group = 'hadoop',
+                              conf_dir = '/etc/hadoop/conf',
+                              configurations = self.getConfig()['configurations']['core-site'],
+                              configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
+                              mode = 0644
+    )
     self.assertResourceCalled('File', '/etc/hadoop/conf/slaves',
                               content = Template('slaves.j2'),
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index 7c7ac46..44e8cf1 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -377,16 +377,28 @@ App.AddServiceController = App.WizardController.extend({
     App.router.get('updateController').updateAll();
   },
 
-  installServices: function (callback) {
-    this.set('content.cluster.oldRequestsId', []);
-    this.installAdditionalClients();
-    var selectedServices = this.get('content.services').filterProperty('isInstalled', false).filterProperty('isSelected',
true).mapProperty('serviceName');
-    var name = 'common.services.update';
-    var data = {
+  /**
+   * genarates data for ajax request to launch install services
+   * @method generateDataForInstallServices
+   * @param {Array} selectedServices
+   * @returns {{context: *, ServiceInfo: {state: string}, urlParams: string}}
+   */
+  generateDataForInstallServices: function(selectedServices) {
+    if (selectedServices.contains('OOZIE')) {
+      selectedServices = selectedServices.concat(['HDFS', 'YARN', 'MAPREDUCE', 'MAPREDUCE2']);
+    }
+    return {
       "context": Em.I18n.t('requestInfo.installServices'),
       "ServiceInfo": {"state": "INSTALLED"},
       "urlParams": "ServiceInfo/service_name.in(" + selectedServices.join(',')  + ")"
     };
+  },
+  installServices: function (callback) {
+    this.set('content.cluster.oldRequestsId', []);
+    this.installAdditionalClients();
+    var name = 'common.services.update';
+    var selectedServices = this.get('content.services').filterProperty('isInstalled', false).filterProperty('isSelected',
true).mapProperty('serviceName');
+    var data = this.generateDataForInstallServices(selectedServices);
     this.installServicesRequest(name, data, callback);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index ba55429..688f7ce 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1439,7 +1439,19 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
{
         }
       }));
     }, this);
-
+    /**
+     * if some services change core-site we should put updates to cluster
+     */
+    if (this.get('content.controllerName') == 'addServiceController' && !selectedServices.someProperty('serviceName',
'HDFS')) {
+      var coreConfig = serviceConfigTags.findProperty('type', 'core-site');
+      if (coreConfig) {
+        allConfigData.pushObject(JSON.stringify({
+          Clusters: {
+            desired_config: [coreConfig]
+          }
+        }));
+      }
+    }
     var clusterConfig = serviceConfigTags.findProperty('type', 'cluster-env');
     if (clusterConfig) {
       allConfigData.pushObject(JSON.stringify({

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-web/app/controllers/wizard/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js
index 277b77c..31d0734 100644
--- a/ambari-web/app/controllers/wizard/step9_controller.js
+++ b/ambari-web/app/controllers/wizard/step9_controller.js
@@ -479,12 +479,15 @@ App.WizardStep9Controller = Em.Controller.extend({
         };
         break;
       case 'addServiceController':
-        var servicesList = this.get('content.services').filterProperty('isSelected').filterProperty('isInstalled',
false).mapProperty('serviceName').join(",");
+        var servicesList = this.get('content.services').filterProperty('isSelected').filterProperty('isInstalled',
false).mapProperty('serviceName');
+        if (servicesList.contains('OOZIE')) {
+          servicesList = servicesList.concat(['HDFS', 'YARN', 'MAPREDUCE', 'MAPREDUCE2']);
+        }
         name = 'common.services.update';
         data = {
           "context": Em.I18n.t("requestInfo.startAddedServices"),
           "ServiceInfo": { "state": "STARTED" },
-          "urlParams": "ServiceInfo/state=INSTALLED&ServiceInfo/service_name.in(" + servicesList
+ ")&params/reconfigure_client=false"
+          "urlParams": "ServiceInfo/state=INSTALLED&ServiceInfo/service_name.in(" + servicesList.join(",")
+ ")&params/reconfigure_client=false"
         };
         break;
       default:

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-web/test/controllers/main/service/add_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/add_controller_test.js b/ambari-web/test/controllers/main/service/add_controller_test.js
index b56a875..03da51d 100644
--- a/ambari-web/test/controllers/main/service/add_controller_test.js
+++ b/ambari-web/test/controllers/main/service/add_controller_test.js
@@ -78,4 +78,30 @@ describe('App.AddServiceController', function() {
 
   });
 
+  describe('#generateDataForInstallServices', function() {
+    var tests = [{
+      selected: ["YARN","HBASE"],
+      res: {
+        "context": Em.I18n.t('requestInfo.installServices'),
+        "ServiceInfo": {"state": "INSTALLED"},
+        "urlParams": "ServiceInfo/service_name.in(YARN,HBASE)"
+      }
+    },
+    {
+      selected: ['OOZIE'],
+      res: {
+        "context": Em.I18n.t('requestInfo.installServices'),
+        "ServiceInfo": {"state": "INSTALLED"},
+        "urlParams": "ServiceInfo/service_name.in(OOZIE,HDFS,YARN,MAPREDUCE,MAPREDUCE2)"
+      }
+    }
+    ]
+    tests.forEach(function(t){
+      it('should generate data with ' + t.selected.join(","), function () {
+        expect(addServiceController.generateDataForInstallServices(t.selected)).to.be.eql(t.res);
+      });
+    });
+
+
+  });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/57c4d722/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index f544e88..7eed8e1 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1291,6 +1291,61 @@ describe('App.WizardStep8Controller', function () {
         installerStep8Controller.applyConfigurationsToCluster(serviceConfigTags);
         expect(installerStep8Controller.addRequestToAjaxQueue.args[0][0].data).to.eql({data:
data});
       });
+
+      it('should call addRequestToAjaxQueue with core-site if addServiceController', function()
{
+        var serviceConfigTags = [
+            {
+              type: 'oozie',
+              tag: 'tag1',
+              properties: [
+                {},
+                {}
+              ]
+            },
+            {
+              type: 'core-site',
+              tag: 'tag1',
+              properties: [
+                {}
+              ]
+            },
+            {
+              type: 'cluster-env',
+              tag: 'tag1',
+              properties: [
+                {}
+              ]
+            }
+          ];
+
+        data = '['+ JSON.stringify({Clusters: {
+              desired_config: [serviceConfigTags[0]]
+            }
+          }) + ',' +
+          JSON.stringify({Clusters: {
+              desired_config: [serviceConfigTags[1]]
+            }
+          }) + ',' +
+          JSON.stringify({Clusters: {
+              desired_config: [serviceConfigTags[2]]
+            }
+          }) + ']';
+        installerStep8Controller.reopen({
+          selectedServices: [
+            Em.Object.create({
+              isSelected: true,
+              isInstalled: false,
+              configTypesRendered: {'oozie': 'tag1' }
+            })
+          ],
+          content: {
+            controllerName: 'addServiceController'
+          }
+        });
+        installerStep8Controller.applyConfigurationsToCluster(serviceConfigTags);
+        var sendData = installerStep8Controller.addRequestToAjaxQueue.args[0][0].data;
+        expect(sendData).to.eql({data: data});
+      });
     });
 
     describe('#applyConfigurationGroups', function() {


Mime
View raw message