Linux用户和HDFS和Hive权限关系
生活随笔
收集整理的這篇文章主要介紹了
Linux用户和HDFS和Hive权限关系
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、Linux用戶組和用戶新建
? ?1)用戶組
? ? ?新建:$groupadd hphs
? ? ?刪除命令:groupdel;
? ? ?屬性修改:groupmod;
? ?2)用戶:
? ? ?新建:#useradd -d /usr/hphs/ -m hphs -g hphs
? ? ?刪除命令:userdel; 帶-r表示刪除用戶相關文件,帶-f 表示強制刪除(即便用戶仍有登錄的)
? ? ?修改賬號:usermod;
? ? ?密碼修改:passwd;
? ?3)用戶組和用戶查看:$cat /etc/passwd
2、賦予HDFS目錄權限:
? ?1)新建hdfs目錄:$hadoop fs -mkdir /user/hphs
? ?2)賦予hphs權限:$hadoop fs -chown -R hphs:hphs /user/hphs
? ?HDFS權限管理用戶指南參考:
? ?http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_permissions_guide.html
3、Hive權限
? ?1)用戶級權限:對于操作系統上用戶進入Hive服務的權限控制,和HDFS權限控制一致,都是ACL支撐。
? ?? <property> <name>hive.metastore.execute.setugi</name> <value>true</value> <description>In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.簡單說就是,hadoop在非安全模式(未使用kerborers認證)時,使用hive客戶端進程對應的用戶和組權限操作hdfs</description> </property>
? ?1)用戶組
? ? ?新建:$groupadd hphs
? ? ?刪除命令:groupdel;
? ? ?屬性修改:groupmod;
? ?2)用戶:
? ? ?新建:#useradd -d /usr/hphs/ -m hphs -g hphs
? ? ?刪除命令:userdel; 帶-r表示刪除用戶相關文件,帶-f 表示強制刪除(即便用戶仍有登錄的)
? ? ?修改賬號:usermod;
? ? ?密碼修改:passwd;
? ?3)用戶組和用戶查看:$cat /etc/passwd
2、賦予HDFS目錄權限:
? ?1)新建hdfs目錄:$hadoop fs -mkdir /user/hphs
? ?2)賦予hphs權限:$hadoop fs -chown -R hphs:hphs /user/hphs
? ?HDFS權限管理用戶指南參考:
? ?http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_permissions_guide.html
3、Hive權限
? ?1)用戶級權限:對于操作系統上用戶進入Hive服務的權限控制,和HDFS權限控制一致,都是ACL支撐。
? ?? <property> <name>hive.metastore.execute.setugi</name> <value>true</value> <description>In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.簡單說就是,hadoop在非安全模式(未使用kerborers認證)時,使用hive客戶端進程對應的用戶和組權限操作hdfs</description> </property>
? ?2)SQL操作權限:Hive數據庫自身角色的權限管理,不同數據庫和表可賦予具體權限的操作
實際上生產遇到的問題是:
1)新建一個linux用戶和用戶組,Hadoop上如何設置其權限,一個是是否允許執行Hadoop命令;另一個是控制具體HDFS路徑;這個應該就是ACL控制了;
2)新建一個linux用戶和用戶組,Hive上如何設置其權限,一個是否允許自行hive命令;另一個是控制具體hive文件路徑(這點應該和Hadoop一致);再一個就是具體庫和表的使用權限;
決定了如何有效管理多用戶使用hadoop和Hive(再同一客戶端),尤其是hadoop集群設置kerberos安全認證下,有待繼續研究。
此前研究的成果還有待繼續優化:
http://blog.csdn.net/fjssharpsword/article/details/51280335
http://blog.csdn.net/fjssharpsword/article/details/51312153
總結
以上是生活随笔為你收集整理的Linux用户和HDFS和Hive权限关系的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【正一专栏】第1球和第500球价值一样
- 下一篇: centos下新建超级用户及sudoer