Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.7.5
-
None
Description
Problem Statement : I am Trying to add namespace to HDFS via Ambari, my HDFS already have two namespaces : namespace1,namespace2 . when i am trying to add the third one say : namespace3, it fails with below script error at Step3:
app.js:5310 Uncaught TypeError: Cannot read property 'split' of undefined at Class.prepareDependencies (app.js:5310) at Class.tweakServiceConfigs (app.js:5337) at Class.onLoad (app.js:5293) at invokeAction (vendor.js:15179) at iterateSet (vendor.js:15161) at Object.sendEvent (vendor.js:15278) at notifyObservers (vendor.js:13870) at Object.Ember.notifyObservers (vendor.js:13985) at Object.propertyDidChange (vendor.js:14618) at set (vendor.js:13424)
Analysis : Upon analysing the code : https://github.com/apache/ambari/blob/release-2.7.5/ambari-web/app/controllers/main/admin/federation/step3_controller.js#L110
It looks we are blindly taking 0th nameService as the one that have namenode1 and namenode2 and then assiging the namenode1 and namenode2 :
var nameServices = App.HDFSService.find().objectAt(0).get('masterComponentGroups').mapProperty('name'); ret.nameServicesList = nameServices.join(','); ret.nameservice1 = nameServices[0]; ret.newNameservice = this.get('content.nameServiceId'); ret.namenode1 = hdfsSiteConfigs['dfs.namenode.rpc-address.' + ret.nameservice1 + '.nn1'].split(':')[0]; ret.namenode2 = hdfsSiteConfigs['dfs.namenode.rpc-address.' + ret.nameservice1 + '.nn2'].split(':')[0];
The abouve logic is wrong, when you try to fetch `nameServices` as abouve the order is not neccessarly the way it was created
This logic need to rewramped.
Attachments
Issue Links
- links to