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. c#数据库访问服务(综合数据库操作)

    前面给大家说封装了常用的数据库,并且整理了使用.最近我再次把项目整合了.做成比较完善的服务. 还是重复的说下数据库操作封装. berkeley db数据库,Redis数据库,sqlite数据库. 每个 ...

  2. 常用Sql server 自定义函数

    /****** 对象: UserDefinedFunction [dbo].[fun_get_LowerFirst] 脚本日期: 08/04/2012 13:03:56 ******/ IF EXIS ...

  3. Windows常用命令,想要看什么命令直接在全文“CTRL+F”检索(转)

    原文地址:https://www.cnblogs.com/kekec/p/3662125.html 打开"运行"对话框(Win+R),输入cmd,打开控制台命令窗口... 也可以通 ...

  4. WIN10远程连接winserver2012 r2,连接失败

    背景:2012开启远程的时候,默认是勾选“仅允许运行使用网络级别身份验证的远程桌面的计算机连接”,这个选项据说比较安全,但是用win10远程的时候就报错,函数不受支持,最后通过修改win10的配置得以 ...

  5. QK对中断的特殊处理

    1.QK的特性 QK(Quntum Kernel)是一个抢占式.基于优先级实时微内核.一个多任务调度器: QK不同于传统的RTOS,是非阻塞的,并且只用了一个stack: 对QK中的任务来说,采用了I ...

  6. HyperLedger Fabric 1.4 单机单节点部署(10.2)

    单机单节点指在一台电脑上部署一个排序(Orderer)服务.一个组织(Org1),一个节点(Peer,属于Org1),然后运行官方案例中的example02智能合约例子,实现转财交易和查询功能.单机单 ...

  7. mac下使用git的冲突的解决方案

    博主之前一直是在windows系统下进行软件代码的开发,window下有很多git的使用工具,如tortoisegit等是个很好的git项目管理工具.而再mac版下的git项目代码管理工具,本人找了好 ...

  8. ACM数论-素数

    ACM数论——素数  素数定义: 质数(prime number)又称素数,有无限个.质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数,这样的数称为质数.例 子:2.3.5.7.11.1 ...

  9. linux 网络编程 1---(基本概念)

    1.TCP和UDP协议 共同点:同为传输层协议 不同点: TCP:有连接,可靠 UPD 无连接,不保证可靠 TCP(即传输控制协议): 是一种面向连接的传输层协议,它是能提供高可靠性通信(即,数据无误 ...

  10. Java设计模式(15)——行为模式之策略模式(Strategy)

    一.概述 概念 UML简图 角色 二.实践 我们先将上述的UML图的抽象情况下的代码写出,然后再给出一个具体的例子 策略接口——当然如果有一些公共的行为,应当使用抽象类! /** * 策略接口 * * ...