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. NodeJ node.js Koa2 跨域请求

    Koa2 .3 跨域请求 Haisen's  需求分析 (localhost:8080 = 前端  [请求]  localhost:8081 = 服务器 ) 1.一个前台    一个服务器    前台 ...

  2. Ubuntu16 安装Anaconda3+tensorflow cpu版

    打开火狐浏览器,下载anaconda安装包,网址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D 下载完成,到Do ...

  3. #leetcode刷题之路8-字符串转换整数 (atoi)

    请你来实现一个 atoi 函数,使其能将字符串转换成整数.首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止.当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之后面 ...

  4. Java并发之synchronized使用

    synchronized,是Java语言的关键字,读['siŋkrənaizd],当它用来修饰一个方法或者一个代码块的时候,能够保证在同一时刻最多只有一个线程执行该段代码. 一.Java为何要使用sy ...

  5. JDBC中执行sql语句的 增 , 删 , 改 , 查 的方法

    executeQuery()  : 执行 SELECT 语句,它几乎是使用最多的 SQL 语句 executeUpdate() :   执行 INSERT.UPDATE 或 DELETE 语句以及 S ...

  6. ORA-12541:TNS:无监听程序问题

    这种情况可能有多种原因,解决办法如下: 方法1.原因:监听日志listener.log过大,超过4. 步骤: a.暂停监听服务 b.删除listener.log,文件位置:E:\app\Adminis ...

  7. PHP中$a && $b = $c 语法的用法

    $a && $b = $c 表示:如果$a为真,则执行$b = $c,否则不执行. 可以用if语句替代: if ($a) { $b = $c; } 实例: $a = true; $b ...

  8. React 源码中的依赖注入方法

    一.前言 依赖注入(Dependency Injection)这个概念的兴起已经有很长时间了,把这个概念融入到框架中达到出神入化境地的,非Spring莫属.然而在前端领域,似乎很少会提到这个概念,难道 ...

  9. java instanceof 的理解

    简单来说,java 中的instanceof 运算符是用来在运行时指出对象是否是特定类的一个实例.instanceof通过返回一个布尔值来指出,这个对象是否是这个特定类或者是它的子类的一个实例. 用法 ...

  10. java 代理模式(模拟代购)

    interface Isubject{ void buyAJ(); } class realsubject implements Isubject{ public void buyAJ(){ Syst ...