1.权限模式

    简单:启动HDFS的操作系统用户即为超级用户,可以通过HADOOP_USER_NAME指定
    kerberos:

2.group mapping 
    组列表由group mapping service完成,该服务由hadoop.security.group.mapping参数决定,默认值是org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback,即由JNI. 如果没有JNI, 使用org.apache.hadoop.security.ShellBasedUnixGroupsMapping,意思是使用shell命令bash -c groups决定group. group mapping 服务由namenode提供

3.如何执行权限
    每次执行一个操作之前都会检查权限。客户端会把用户标识发给namenode.

4.改变文件系统权限的API
    
  • public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException;
  • public boolean mkdirs(Path f, FsPermission permission) throws IOException;
  • public void setPermission(Path p, FsPermission permission) throws IOException;
  • public void setOwner(Path p, String username, String groupname) throws IOException;
  • public FileStatus getFileStatus(Path f) throws IOException;

5.改变文件系统权限的shell
   
  • chmod [-R] mode file …

    Only the owner of a file or the super-user is permitted to change the mode of a file.

  • chgrp [-R] group file …

    The user invoking chgrp must belong to the specified group and be the owner of the file, or be the super-user.

  • chown [-R] [owner][:[group]] file …

    The owner of a file may only be altered by a super-user.

  • ls file …
  • lsr file …
以上命令使用bin/hdfs dfs -执行

6.配置参数
 
  • dfs.permissions.enabled = true   是否启用权限

    If yes use the permissions system as described here. If no, permission checking is turned off, but all other behavior is unchanged. Switching from one parameter value to the other does not change the mode, owner or group of files or directories. Regardless of whether permissions are on or off, chmod, chgrp, chown and setfacl always check permissions. These functions are only useful in the permissions context, and so there is no backwards compatibility issue. Furthermore, this allows administrators to reliably set owners and permissions in advance of turning on regular permissions checking.

  • dfs.web.ugi = webuser,webgroup   

    The user name to be used by the web server. Setting this to the name of the super-user allows any web client to see everything. Changing this to an otherwise unused identity allows web clients to see only those things visible using "other" permissions. Additional groups may be added to the comma-separated list.

  • dfs.permissions.superusergroup = supergroup   超级用户组

    The name of the group of super-users.

  • fs.permissions.umask-mode = 0022    

    The umask used when creating files and directories. For configuration files, the decimal value 18 may be used.

  • dfs.cluster.administrators = ACL-for-admins

    The administrators for the cluster specified as an ACL. This controls who can access the default servlets, etc. in the HDFS.

  • dfs.namenode.acls.enabled = true  

    Set to true to enable support for HDFS ACLs (Access Control Lists). By default, ACLs are disabled. When ACLs are disabled, the NameNode rejects all attempts to set an ACL.









七:HDFS Permissions Guide 权限的更多相关文章

  1. HDFS权限管理指南(HDFS Permissions Guide)

    综述 HDFS实现了一个类似POSIX模型的文件和文件夹权限管理模型.每一个文件盒文件夹都有一个所有者和一个组.文件或者文件夹可以通过权限区分是所有者还是组成员或是其他用户.对文件来说,r标示可以阅读 ...

  2. HDFS Users Guide

    Purpose This document is a starting point for users working with Hadoop Distributed File System (HDF ...

  3. [HDFS Manual] CH2 HDFS Users Guide

    2 HDFS Users Guide 2 HDFS Users Guide 2.1目的 2.2.概述 2.3.先决条件 2.4. Web Interface 2.5. Shell Command 2. ...

  4. 解决从本地文件系统上传到HDFS时的权限问题

    当使用 hadoop fs -put localfile /user/xxx 时提示: put: Permission denied: user=root, access=WRITE, inode=& ...

  5. Apache Ranger对HDFS的访问权限控制的原理分析(一)

    介绍 Aapche Ranger是以插件的形式集成到HDFS中,由Ranger Admin管理访问策略,Ranger插件定期轮询Admin更新策略到本地,并根据策略信息进行用户访问权限的判定.Rang ...

  6. HDFS客户端的权限错误:Permission denied

    报错:Permission denied: user=root, access=WRITE, inode="hadoop":hadoop:supergroup:rwxr-xr-x ...

  7. [HDFS Manual] CH3 HDFS Commands Guide

    HDFS Commands Guide HDFS Commands Guide 3.1概述 3.2 用户命令 3.2.1 classpath 3.2.2 dfs 3.2.3 envvars 3.2.4 ...

  8. 4、一、Introduction(入门):3、System Permissions(系统权限)

    3.System Permissions(系统权限)   Android is a privilege-separated operating system, in which each applic ...

  9. hdfs的文件个数 HDFS Quotas Guide

    HDFS Quotas Guide Overview HDFS允许管理员为多个每个目录设置使用的命名空间和空间的配额.命名空间配额和空间配额独立操作,但是这两种类型的配额的管理和实现非常类似. Nam ...

随机推荐

  1. WebGL学习笔记(1)

    基本的WebGL图形操作(详细参考教程:https://www.yiibai.com/webgl,需要1周左右熟悉webgl的对象方法以及着色器代码):绘制三角形 drawElements gl.TR ...

  2. 【模板】负环(spfa)

    题目描述 暴力枚举/SPFA/Bellman-ford/奇怪的贪心/超神搜索 输入输出格式 输入格式: 第一行一个正整数T表示数据组数,对于每组数据: 第一行两个正整数N M,表示图有N个顶点,M条边 ...

  3. 09JavaScript函数

    函数是由事件驱动的或者当它被调用时执行的可重复使用的代码块. 实例1: <!DOCTYPE html> <html> <head> <meta charset ...

  4. 关于mybatis编写sql问题.

    最近呢楼主回到长沙进行面试:被问了一个这样的问题,在mybatis中怎么进行模糊查询,望各位大佬在下方进行评论,好让我这菜鸡多学习一些.

  5. PHP运行原理之Opcodes

    在我之前的博客<Laravel5框架性能优化技巧>中提到开启OPcache可以提升php性能.那么为什么开启OPcache就可以提升php运行性能呢?这里就要提到php的运行原理了--Op ...

  6. PHP获取当月天数,获取当月的每天的开始和结束的时间戳,获取当月每号

    由于经常要写导单和数据分析功能,所以要获取什么时间的数据,想什么当天,周,年,月之类的时间格式都很好获取.我今天在这里为大家提供的是当月每天的开始和结束的时间格式. 希望能帮到大家!!! # 获取当月 ...

  7. ArrayList的源码分析(基于jdk1.8)

    1.初始化 transient Object[] elementData; //实际存储元素的数组 private static final Object[] DEFAULTCAPACITY_EMPT ...

  8. JAVA 中的文件读取

    1. InputStream / OutputStream处理字节流抽象类:所有输入.输出(内存)类的超类,一般使用 FileInputStream / FileOutputStream 输出字符 u ...

  9. Hadoop mapreduce框架简介

    传统hadoop MapReduce架构(老架构)   从上图中可以清楚的看出原 MapReduce 程序的流程及设计思路:   1.首先用户程序 (JobClient) 提交了一个 job,job ...

  10. 企业网站被黑 dedecms漏洞修复办法

    前段时间网站被黑了,从百度打开网站直接被劫持跳转到了彩票,du博网站上去,网站的首页index.html文件也被篡改成一些什么北京sai车,pk10,一些cai票的关键词内容,搞得网站根本无法正常浏览 ...