ソースを参照

AMBARI-2367. HCFS properties in core-site are being set to null. (Chad Roberts via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1493944 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年 前
コミット
1b623274c3

+ 19 - 3
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1359,8 +1359,17 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   createGlobalSiteObj: function () {
     var globalSiteProperties = {};
-    //this.get('globals').filterProperty('domain', 'global').forEach(function (_globalSiteObj) {
-    this.get('globals').forEach(function (_globalSiteObj) {
+    var globalSiteObj = this.get('globals');
+    var isHCFSSelected = this.get('selectedServices').someProperty('serviceName', 'HCFS');
+    
+    // screen out the HCFS-specific global config entries when they are not required
+    if (!isHCFSSelected) {
+      globalSiteObj = globalSiteObj.filter(function(_config) {
+        return _config.name.indexOf("fs_glusterfs") < 0;
+      });
+    }
+    
+    globalSiteObj.forEach(function (_globalSiteObj) {
       // do not pass any globals whose name ends with _host or _hosts
       if (!/_hosts?$/.test(_globalSiteObj.name)) {
         // append "m" to JVM memory options except for hadoop_heapsize
@@ -1393,13 +1402,20 @@ App.WizardStep8Controller = Em.Controller.extend({
     var isHcatSelected = this.get('selectedServices').someProperty('serviceName', 'WEBHCAT');
     var hcatUser = this.get('globals').someProperty('name', 'hcat_user') ? this.get('globals').findProperty('name', 'hcat_user').value : null;
     var isHCFSSelected = this.get('selectedServices').someProperty('serviceName', 'HCFS');
+    
+    // screen out the HCFS-specific core-site.xml entries when they are not needed
+    if (!isHCFSSelected) {
+       coreSiteObj = coreSiteObj.filter(function(_config) {
+         return _config.name.indexOf("fs.glusterfs") < 0;
+      });
+    }
     coreSiteObj.forEach(function (_coreSiteObj) {
       if ((isOozieSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + oozieUser + '.groups')) && (isHiveSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hiveUser + '.groups')) && (isHcatSelected || (_coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + hcatUser + '.groups'))) {
         coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value;
         this._recordHostOverrideFromObj(_coreSiteObj, 'core-site', 'version1', this);
       }
       if (isHCFSSelected && _coreSiteObj.name == "fs.default.name") {
-        coreSiteProperties[_coreSiteObj.name] = this.get('globals').someProperty('name', 'fs_default_name') ? this.get('globals').findProperty('name', 'fs_default_name').value : null;
+        coreSiteProperties[_coreSiteObj.name] = this.get('globals').someProperty('name', 'fs_glusterfs_default_name') ? this.get('globals').findProperty('name', 'fs_glusterfs_default_name').value : null;
       }
       console.log("STEP*: name of the property is: " + _coreSiteObj.name);
       console.log("STEP8: value of the property is: " + _coreSiteObj.value);

+ 1 - 1
ambari-web/app/data/config_properties.js

@@ -468,7 +468,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "fs_default_name",
+      "name": "fs_glusterfs_default_name",
       "displayName": "Gluster default fs name",
       "description": "Gluster default filesystem name (glusterfs://{MasterFQDN}:9000)",
       "defaultValue": "glusterfs://{firstHost}:9000",