Support Questions

Find answers, ask questions, and share your expertise

/apps/hive/warehouse permission is showing 777 by default

avatar
Guru

Team,

If we create a database or internal tables then by default it is creating with 777 permission.

I have umask in hdfs but not sure why it is not applicable for /apps/hive/warehouse dir. So any idea how we can prevent it from 777 to 755 or 750.

Thanks in advance.

1 ACCEPTED SOLUTION

avatar
@Saurabh Kumar

Changing the warehouse directory permission

1.From the command line in the Ambari server node, edit the file

  1. /var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
    
  2. Search for hive_apps_whs_dir which should go to this block:
      params.HdfsResource(params.hive_apps_whs_dir,
        type="directory",
        action="create_on_execute",
        owner=params.hive_user,
        group=params.user_group,
        mode=0755
      )
    
  3. Modify the value for mode from 0755 to the desired permission, for example 0777.
  4. Save and close the file.
  5. Restart the Ambari server to propagate the change to all nodes in the cluster:
    ambari-server restart
    

    It may take a few seconds to update the file in the Ambari agents on all nodes. To verify if the change has been applied on a particular node, check the content of hive.py in

    /var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
    
  6. From the Ambari UI, restart HiveServer2 to apply the new permission to the warehouse directory. If multiple HiveServer2 instances are configured, any one instance can be restarted.

Hope this helps you.

View solution in original post

1 REPLY 1

avatar
@Saurabh Kumar

Changing the warehouse directory permission

1.From the command line in the Ambari server node, edit the file

  1. /var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
    
  2. Search for hive_apps_whs_dir which should go to this block:
      params.HdfsResource(params.hive_apps_whs_dir,
        type="directory",
        action="create_on_execute",
        owner=params.hive_user,
        group=params.user_group,
        mode=0755
      )
    
  3. Modify the value for mode from 0755 to the desired permission, for example 0777.
  4. Save and close the file.
  5. Restart the Ambari server to propagate the change to all nodes in the cluster:
    ambari-server restart
    

    It may take a few seconds to update the file in the Ambari agents on all nodes. To verify if the change has been applied on a particular node, check the content of hive.py in

    /var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
    
  6. From the Ambari UI, restart HiveServer2 to apply the new permission to the warehouse directory. If multiple HiveServer2 instances are configured, any one instance can be restarted.

Hope this helps you.