Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

can't start with home(s) in ambari

avatar
New Contributor

I am using HDP 2.6.1.0-129, I want to change the namenode and data directories to /home beacuse i have much disk memory in /home but Ambari is not allowing to /home its showing that "can't start with home(s)"

Similar Issue in Jira : https://issues.apache.org/jira/browse/AMBARI-9254

I have attached the screenshots

Could you please someone help in fixing this.

42782-error.png

42781-dfsize.png

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Manjunath H

This is as per ambari design that you can not use the "/home" directory for NameNode data. This functionality is there in Ambari from Ambari 1.5.0 version till date. The Following is the JIRA where this check was added long back: https://issues.apache.org/jira/browse/AMBARI-4162

.

If you want to know the validation rules then please refer to the following code:

0. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/utils/validator.js#L94-L107

  /**
   * validate directory doesn't start "home" or "homes"
   * @param value
   * @returns {boolean}
   */
  isAllowedDir: function(value) {
    var dirs = value.replace(/,/g,' ').trim().split(new RegExp("\\s+", "g"));
    for(var i = 0; i < dirs.length; i++){
      if(dirs[i].startsWith('/home') || dirs[i].startsWith('/homes')) {
        return false;
      }
    }
    return true;
  },

Other reference:
1. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/utils/config.js#L633-L635
2. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/messages.js#L3254

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Manjunath H

This is as per ambari design that you can not use the "/home" directory for NameNode data. This functionality is there in Ambari from Ambari 1.5.0 version till date. The Following is the JIRA where this check was added long back: https://issues.apache.org/jira/browse/AMBARI-4162

.

If you want to know the validation rules then please refer to the following code:

0. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/utils/validator.js#L94-L107

  /**
   * validate directory doesn't start "home" or "homes"
   * @param value
   * @returns {boolean}
   */
  isAllowedDir: function(value) {
    var dirs = value.replace(/,/g,' ').trim().split(new RegExp("\\s+", "g"));
    for(var i = 0; i < dirs.length; i++){
      if(dirs[i].startsWith('/home') || dirs[i].startsWith('/homes')) {
        return false;
      }
    }
    return true;
  },

Other reference:
1. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/utils/config.js#L633-L635
2. https://github.com/apache/ambari/blob/release-2.6.0/ambari-web/app/messages.js#L3254

.

avatar
New Contributor

Thanks Jay.

Can I comment/remove this code in app.js of /usr/lib/ambari-server/web/javascripts location and restart the ambari server if I want to use /home directory for storage..??

avatar
Master Mentor

@Manjunath H

Yes, commenting that Java script check should pass the the validation and ambari should allow the "/home" directory usage for NameNode data store.

However that will not be a best practice. But of course you can try that at your own risk.

avatar

I get the same problem , when I install the cluster , at very firs time . please help me